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


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

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

LLVM IR (-O0):
define i32 @test_imm_25uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -37
%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_25uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -37
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned int eruConfigureETL2(unsigned int exs_a_input,
                              unsigned int exs_b_input, unsigned int exicon) {
  unsigned int exisel = (*((volatile unsigned int *const)(0x40010600 + 0x00)));
  exisel &= !((3 << 8) | (3 << 10));
  exisel |= ((exs_a_input << 8) | (exs_b_input << 10));
  (*((volatile unsigned int *const)(0x40010600 + 0x00))) = exisel;
  (*((volatile unsigned int *const)(0x40010600 + 0x18))) = exicon;
  return 0;
}


x86 assembly (clang, -O0):
<eruConfigureETL2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x40010600,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
shl    $0xa,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x40010600,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0x40010618,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eruConfigureETL2>:
mov    0x40010600,%eax
shl    $0x8,%edi
shl    $0xa,%esi
or     %edi,%esi
mov    %esi,0x40010600
mov    %edx,0x40010618
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eruConfigureETL2(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 volatile i32, i32* inttoptr (i64 1073808896 to i32*)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = and i32 %9, 0
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = shl i32 %11, 8
%13 = load i32, i32* %5
%14 = shl i32 %13, 10
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = or i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %7
store volatile i32 %18, i32* inttoptr (i64 1073808896 to i32*)
%19 = load i32, i32* %6
store volatile i32 %19, i32* inttoptr (i64 1073808920 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @eruConfigureETL2(i32 %0, i32 %1, i32 %2) {
%4 = load volatile i32, i32* inttoptr (i64 1073808896 to i32*)
%5 = shl i32 %0, 8
%6 = shl i32 %1, 10
%7 = or i32 %6, %5
store volatile i32 %7, i32* inttoptr (i64 1073808896 to i32*)
store volatile i32 %2, i32* inttoptr (i64 1073808920 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DVFragmentedSendNotify_Destroy(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<DVFragmentedSendNotify_Destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DVFragmentedSendNotify_Destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int rp_app_init() {
  fprintf(stderr, "Starting MCPHA server.\n");
  system("/opt/redpitaya/www/apps/mcpha/start.sh");
  return 0;
}


x86 assembly (clang, -O0):
<rp_app_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_init>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xedb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Starting MCPHA server.\0A\00"
@.str.1 = [39 x i8] c"/opt/redpitaya/www/apps/mcpha/start.sh\00"
define i32 @rp_app_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Starting MCPHA server.\0A\00"
@.str.1 = [39 x i8] c"/opt/redpitaya/www/apps/mcpha/start.sh\00"
define i32 @rp_app_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int recv_fds(int, int *, int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int recv_fd(int sock) {
  int fd, ret;
  ret = recv_fds(sock, &fd, 1, NULL, 0);
  if (ret)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<recv_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <recv_fds@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114c <recv_fd+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <recv_fd+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_fd>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <recv_fds@plt>
neg    %eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @recv_fd(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @recv_fds(i32 %0, i32* %2, i32 1, i32* null, i32 0)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(const char *name) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.hostent = type { i32 }
define %struct.hostent* @gethostbyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.hostent* null
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define noalias %struct.hostent* @gethostbyname(i8* nocapture readnone %0) {
ret %struct.hostent* null
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int uint32_t;
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t get16bit(const uint8_t **ptr) {
  uint32_t t16;
  t16 = (*ptr)[1] + 256U * (*ptr)[0];
  (*ptr) += 2;
  return t16;
}


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

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

LLVM IR (-O0):
define i32 @get16bit(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = mul i32 256, %11
%13 = add i32 %7, %12
store i32 %13, i32* %3
%14 = load i32**, i32*** %2
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32* %16, i32** %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @get16bit(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = add i32 %6, %4
%8 = getelementptr inbounds i32, i32* %2, i64 2
store i32* %8, i32** %0
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ACE_makecard(int i) { return 1 << (2 * (i % 13) + 6) | 1 << (i / 13); }


x86 assembly (clang, -O0):
<ACE_makecard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
shl    $0x1,%ecx
add    $0x6,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ACE_makecard>:
movslq %edi,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,2),%eax
lea    (%rdx,%rax,4),%eax
sub    %eax,%ecx
add    %ecx,%ecx
add    $0x6,%cl
mov    $0x1,%eax
shl    %cl,%eax
bts    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ACE_makecard(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 13
%5 = mul nsw i32 2, %4
%6 = add nsw i32 %5, 6
%7 = shl i32 1, %6
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 13
%10 = shl i32 1, %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ACE_makecard(i32 %0) {
%2 = srem i32 %0, 13
%3 = shl nsw i32 %2, 1
%4 = add nsw i32 %3, 6
%5 = shl nuw i32 1, %4
%6 = sdiv i32 %0, 13
%7 = shl nuw i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}
/* Type definitions */
struct __res_state {
  int dummy;
};

/* Variables and functions */
struct __res_state *__res_state() {
  static struct __res_state res;
  return &res;
}


x86 assembly (clang, -O0):
<__res_state>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__res_state>:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
%struct.__res_state = type { i32 }
@__res_state.res = internal global %struct.__res_state zeroinitializer
define %struct.__res_state* @__res_state() {
ret %struct.__res_state* @__res_state.res
}

LLVM IR (-O2):
%struct.__res_state = type { i32 }
@__res_state.res = internal global %struct.__res_state zeroinitializer
define %struct.__res_state* @__res_state() {
ret %struct.__res_state* @__res_state.res
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello, universe\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"hello, universe\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
f(a) {
  switch (a) { case 5 ... 3:; }
}


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

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
]
5: ; No predecessors!
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_comment_option() {
  fprintf(stderr, "The -c option is not yet implemented.\n"
                  "Defaulting to automatic detection.\n");
}


x86 assembly (clang, -O0):
<error_comment_option>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_comment_option>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [74 x i8] c"The -c option is not yet implemented.\0ADefaulting to automatic detection.\0A\00"
define void @error_comment_option() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [74 x i8] c"The -c option is not yet implemented.\0ADefaulting to automatic detection.\0A\00"
define void @error_comment_option() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}
double trunc(double x) {
  return ({
    extern __typeof__(trunc) module_libc_trunc;
    &module_libc_trunc;
  })(x);
}


x86 assembly (clang, -O0):
<trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc>:
jmp    1030 <module_libc_trunc@plt>

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

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call double @module_libc_trunc(double %0)
ret double %2
}
unsigned long GenerateRandomNumber(void) {
  static unsigned long randSeed = 22222;
  randSeed = (randSeed * 196314165) + 907633515;
  return randSeed;
}


x86 assembly (clang, -O0):
<GenerateRandomNumber>:
push   %rbp
mov    %rsp,%rbp
imul   $0xbb38435,0x2f11(%rip),%rax
35 84 b3 0b
add    $0x3619636b,%rax
mov    %rax,0x2f04(%rip)
mov    0x2efd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerateRandomNumber>:
imul   $0xbb38435,0x2f15(%rip),%rax
35 84 b3 0b
add    $0x3619636b,%rax
mov    %rax,0x2f08(%rip)
ret

LLVM IR (-O0):
@GenerateRandomNumber.randSeed = internal global i64 22222
define i64 @GenerateRandomNumber() {
%1 = load i64, i64* @GenerateRandomNumber.randSeed
%2 = mul i64 %1, 196314165
%3 = add i64 %2, 907633515
store i64 %3, i64* @GenerateRandomNumber.randSeed
%4 = load i64, i64* @GenerateRandomNumber.randSeed
ret i64 %4
}

LLVM IR (-O2):
@GenerateRandomNumber.randSeed = internal unnamed_addr global i64 22222
define i64 @GenerateRandomNumber() {
%1 = load i64, i64* @GenerateRandomNumber.randSeed
%2 = mul i64 %1, 196314165
%3 = add i64 %2, 907633515
store i64 %3, i64* @GenerateRandomNumber.randSeed
ret i64 %3
}
int main(int argc, char **argv) { return argv[0] == "something"; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xee3(%rip),%rcx
cmp    %rcx,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef9(%rip),%rcx
xor    %eax,%eax
cmp    %rcx,(%rsi)
sete   %al
ret

LLVM IR (-O0):
@.str = [10 x i8] c"something\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"something\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
%5 = zext i1 %4 to i32
ret i32 %5
}
int caracter_valido(char caracter) {
  int toreturn = 0;
  switch (caracter) {
  case '+':
    toreturn = 1;
  case '-':
    toreturn = 1;
  case '*':
    toreturn = 1;
  case '/':
    toreturn = 1;
  case ')':
    toreturn = 1;
  case '(':
    toreturn = 1;
  }
  return toreturn;
}


x86 assembly (clang, -O0):
<caracter_valido>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1165 <caracter_valido+0x65>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<caracter_valido>:
add    $0xffffffd8,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <caracter_valido+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @caracter_valido(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 43, label %6
i32 45, label %7
i32 42, label %8
i32 47, label %9
i32 41, label %10
i32 40, label %11
]
6: ; preds = %1
store i32 1, i32* %3
br label %7
7: ; preds = %1, %6
store i32 1, i32* %3
br label %8
8: ; preds = %1, %7
store i32 1, i32* %3
br label %9
9: ; preds = %1, %8
store i32 1, i32* %3
br label %10
10: ; preds = %1, %9
store i32 1, i32* %3
br label %11
11: ; preds = %1, %10
store i32 1, i32* %3
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@switch.table.caracter_valido = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @caracter_valido(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -40
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.caracter_valido, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
int putchar(int int_c) { return int_c; }


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *, int /*<<< orphan*/);
extern void dutch_UTF_8_close_env(struct SN_env *z) { SN_close_env(z, 0); }


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

x86 assembly (clang, -O2):
<dutch_UTF_8_close_env>:
xor    %esi,%esi
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @dutch_UTF_8_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @dutch_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int delta_equals(const void *a, const void *b) {
  const char *s0 = a;
  const char *s1 = b;
  return !strcmp(s0, s1);
}


x86 assembly (clang, -O0):
<delta_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @delta_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @strcmp(i8* %9, i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @delta_equals(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int *foo();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int *a = foo();
  int b = *a;
  printf("%d\n", b);
  return 0;
}


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   1040 <foo@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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
%8 = call i32* (...) @foo()
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @foo()
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
double KL_estimator_circulardist(int, int, int, double *, int, double *);
void __R_KL_estimator_circulardist(int *p, int *k, int *n, double *A, int *m,
                                   double *B, double *kl) {
  *kl = KL_estimator_circulardist(*p, *k, *n, A, *m, B);
}


x86 assembly (clang, -O0):
<__R_KL_estimator_circulardist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%r9
call   1030 <KL_estimator_circulardist@plt>
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__R_KL_estimator_circulardist>:
push   %rbx
mov    0x10(%rsp),%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%r8),%r8d
call   1030 <KL_estimator_circulardist@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__R_KL_estimator_circulardist(i32* %0, i32* %1, i32* %2, double* %3, i32* %4, double* %5, double* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca double*
%14 = alloca double*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store double* %3, double** %11
store i32* %4, i32** %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load double*, double** %11
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = load double*, double** %13
%25 = call double @KL_estimator_circulardist(i32 %16, i32 %18, i32 %20, double* %21, i32 %23, double* %24)
%26 = load double*, double** %14
store double %25, double* %26
ret void
}

LLVM IR (-O2):
define void @__R_KL_estimator_circulardist(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, double* %3, i32* nocapture %4, double* %5, double* nocapture writeonly %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = tail call double @KL_estimator_circulardist(i32 %8, i32 %9, i32 %10, double* %3, i32 %11, double* %5)
store double %12, double* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OS_ShutdownPending();
void OS_Sigusr1Handler(int signo) { OS_ShutdownPending(); }


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

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

LLVM IR (-O0):
define void @OS_Sigusr1Handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @OS_ShutdownPending()
ret void
}

LLVM IR (-O2):
define void @OS_Sigusr1Handler(i32 %0) {
%2 = tail call i32 (...) @OS_ShutdownPending()
ret void
}
void gtk_plug_get_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_plug_get_id() {
ret void
}
/* Type definitions */
typedef scalar_t__ const int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t int16p_comparator(const void *pl, const void *pr) {
  return *(const int16_t *)pl - *(const int16_t *)pr;
}


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

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

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

LLVM IR (-O2):
define i64 @int16p_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
ret i64 %7
}
void plus_ten1(int a) { a = a + 10; }


x86 assembly (clang, -O0):
<plus_ten1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @plus_ten1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @plus_ten1(i32 %0) {
ret void
}
void parse_precomment(s) char *s;
{
  char package[40];
  char *p;
  if (*s == '%') {
    p = s + 1;
    readstr(package, &p, 40);
    event_specific(package, p);
  } else {
    event_comment(s);
  };
}


x86 assembly (clang, -O0):
<parse_precomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    1180 <parse_precomment+0x50>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x28,%edx
mov    $0x0,%al
call   1030 <readstr@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <event_specific@plt>
jmp    118b <parse_precomment+0x5b>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <event_comment@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_precomment>:
push   %rbx
sub    $0x40,%rsp
cmpb   $0x25,(%rdi)
jne    1171 <parse_precomment+0x41>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x28,%edx
xor    %eax,%eax
call   1030 <readstr@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <event_specific@plt>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1050 <event_comment@plt>

LLVM IR (-O0):
define void @parse_precomment(i8* %0) {
%2 = alloca i8*
%3 = alloca [40 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 37
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %4
%12 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, i8**, i32, ...) bitcast (i32 (...)* @readstr to i32 (i8*, i8**, i32, ...)*)(i8* %12, i8** %4, i32 40)
%14 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%15 = load i8*, i8** %4
%16 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @event_specific to i32 (i8*, i8*, ...)*)(i8* %14, i8* %15)
br label %20
17: ; preds = %1
%18 = load i8*, i8** %2
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @event_comment to i32 (i8*, ...)*)(i8* %18)
br label %20
20: ; preds = %17, %9
ret void
}

LLVM IR (-O2):
define void @parse_precomment(i8* %0) {
%2 = alloca [40 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = bitcast i8** %3 to i8*
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 37
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8* %9, i8** %3
%10 = call i32 (i8*, i8**, i32, ...) bitcast (i32 (...)* @readstr to i32 (i8*, i8**, i32, ...)*)(i8* %4, i8** %3, i32 40)
%11 = load i8*, i8** %3
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @event_specific to i32 (i8*, i8*, ...)*)(i8* %4, i8* %11)
br label %15
13: ; preds = %1
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @event_comment to i32 (i8*, ...)*)(i8* %0)
br label %15
15: ; preds = %13, %8
ret void
}
int gcd_substraction(int a, int b) {
  while (a != b) {
    if (a > b) {
      a = a - b;
    } else {
      b = b - a;
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd_substraction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113e <gcd_substraction+0x3e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <gcd_substraction+0x30>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <gcd_substraction+0x39>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd_substraction+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_substraction>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <gcd_substraction+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <gcd_substraction+0x10>
ret

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

LLVM IR (-O2):
define i32 @gcd_substraction(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub nsw i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub nsw i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t EEPROMStatusGet(void) {
  return ((*((volatile unsigned long *)(0x400AF018))));
}


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

x86 assembly (clang, -O2):
<EEPROMStatusGet>:
mov    0x400af018,%rax
40
ret

LLVM IR (-O0):
define i64 @EEPROMStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @EEPROMStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
ret i64 %1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t badvpn_read_be16(const char *c_ptr) {
  const uint8_t *ptr = (const uint8_t *)c_ptr;
  return ((uint16_t)ptr[0] << 8) | ((uint16_t)ptr[1] << 0);
}


x86 assembly (clang, -O0):
<badvpn_read_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @badvpn_read_be16(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 8
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 0
%16 = or i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @badvpn_read_be16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = or i32 %5, %9
ret i32 %10
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONUniUnusedR(const struct feature_pair *pair,
                         const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniUnusedR(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniUnusedR(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
scalar_t__ fdim(double, double);
long double fdiml(long double x, long double y) {
  return (long double)fdim((double)x, (double)y);
}


x86 assembly (clang, -O0):
<fdiml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <fdim@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiml>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <fdim@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @fdim(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @fdim(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
float log(float);
float expdev(long *idum) {
  float ran1(long *idum);
  float dum;
  do
    dum = ran1(idum);
  while (dum == 0.0);
  return -log(dum);
}


x86 assembly (clang, -O0):
<expdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ran1@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115b <expdev+0x3b>
jp     115b <expdev+0x3b>
jmp    112c <expdev+0xc>
movss  -0xc(%rbp),%xmm0
call   1040 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdev>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <ran1@plt>
ucomiss 0xed1(%rip),%xmm0
jne    1143 <expdev+0x23>
jnp    1130 <expdev+0x10>
call   1040 <log@plt>
xorps  0xeb1(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @expdev(i64* %0) {
%2 = alloca i64*
%3 = alloca float
store i64* %0, i64** %2
br label %4
4: ; preds = %7, %1
%5 = load i64*, i64** %2
%6 = call float @ran1(i64* %5)
store float %6, float* %3
br label %7
7: ; preds = %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load float, float* %3
%13 = call float @log(float %12)
%14 = fneg float %13
ret float %14
}

LLVM IR (-O2):
define float @expdev(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call float @ran1(i64* %0)
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call float @log(float %3)
%7 = fneg float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ fun(char *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  char a[] = "this is a book.";
  scanf("%d", &n);
  fun(a, n);
  puts(a);
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <fun@plt>
lea    -0x20(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <fun@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [16 x i8] c"this is a book.\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @fun(i8* %6, i32 %7)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
%11 = call i32 (...) @getchar()
%12 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [16 x i8] c"this is a book.\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @fun(i8* %4, i32 %6)
%8 = call i32 @puts(i8* %4)
%9 = call i32 (...) @getchar()
%10 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x63() {
  Assert_real((iscntrl(99) == 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_iscntrl.c",
              500, ("iscntrl should be 0 for c"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x63>:
push   %rax
mov    $0x63,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1f4,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for c\00"
define void @t_iscntrl_0x63() {
%1 = call i64 @iscntrl(i32 99)
%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 500, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for c\00"
define void @t_iscntrl_0x63() {
%1 = tail call i64 @iscntrl(i32 99)
%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 500, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void A_inv(uint16_t *l, uint16_t *r) {
  (*r) ^= (*l);
  (*r) = ((((*r)) << 14) | (((*r)) >> (16 - (14))));
  (*l) -= (*r);
  (*l) = ((((*l)) << 7) | (((*l)) >> (16 - (7))));
}


x86 assembly (clang, -O0):
<A_inv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0xe,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x2,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x7,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x9,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<A_inv>:
mov    (%rsi),%eax
xor    (%rdi),%eax
mov    %eax,%ecx
shl    $0xe,%ecx
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,(%rsi)
mov    (%rdi),%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shl    $0x7,%eax
sar    $0x9,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @A_inv(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = shl i32 %11, 14
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = ashr i32 %14, 2
%16 = or i32 %12, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = load i32*, i32** %3
%21 = load i32, i32* %20
%22 = sub nsw i32 %21, %19
store i32 %22, i32* %20
%23 = load i32*, i32** %3
%24 = load i32, i32* %23
%25 = shl i32 %24, 7
%26 = load i32*, i32** %3
%27 = load i32, i32* %26
%28 = ashr i32 %27, 9
%29 = or i32 %25, %28
%30 = load i32*, i32** %3
store i32 %29, i32* %30
ret void
}

LLVM IR (-O2):
define void @A_inv(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
%6 = shl i32 %5, 14
%7 = ashr i32 %5, 2
%8 = or i32 %6, %7
store i32 %8, i32* %1
%9 = load i32, i32* %0
%10 = sub nsw i32 %9, %8
%11 = shl i32 %10, 7
%12 = ashr i32 %10, 9
%13 = or i32 %11, %12
store i32 %13, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glEnd();
int end_draw(void) { glEnd(); }


x86 assembly (clang, -O0):
<end_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <glEnd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @end_draw() {
%1 = alloca i32
%2 = call i32 (...) @glEnd()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @end_draw() {
%1 = tail call i32 (...) @glEnd()
ret i32 undef
}