xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, int);
int match(const char *buf, const char *str, int len) {
  int ret;
  memcmp(buf, str, len) == 0 ? (ret = 1) : (ret = 0);
  return ret;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1149 <match+0x39>
movl   $0x1,-0x18(%rbp)
jmp    1150 <match+0x40>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @match(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i64 @memcmp(i8* %8, i8* %9, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 1, i32* %7
br label %15
14: ; preds = %3
store i32 0, i32* %7
br label %15
15: ; preds = %14, %13
%16 = phi i32 [ 1, %13 ], [ 0, %14 ]
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int ssize_t;

/* Variables and functions */
uint16_t sparsetable_pos_in_group(ssize_t i) { return (uint16_t)(i % 48); }


x86 assembly (clang, -O0):
<sparsetable_pos_in_group>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sparsetable_pos_in_group>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
shl    $0x4,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sparsetable_pos_in_group(i32 %0) {
%2 = srem i32 %0, 48
ret i32 %2
}
int test_imm_C8int32_mem(int *val) {
  return ((*val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 200
%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_C8int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 200
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void OSAL_TaskSleep(unsigned int TaskSleepPeriod) {
  struct timespec ts, tr;
  ts.tv_sec = TaskSleepPeriod / 1000;
  ts.tv_nsec = (TaskSleepPeriod % 1000) * 1000000;
  nanosleep(&ts, &tr);
}


x86 assembly (clang, -O0):
<OSAL_TaskSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSAL_TaskSleep>:
sub    $0x18,%rsp
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,0x8(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @OSAL_TaskSleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = urem i32 %8, 1000
%10 = mul i32 %9, 1000000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %10, i32* %11
%12 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @OSAL_TaskSleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = udiv i32 %0, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %6, i32* %7
%8 = urem i32 %0, 1000
%9 = mul nuw nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_b(struct cpu *, unsigned char);
int /*<<< orphan*/ cpu_set_c(struct cpu *, unsigned char);
void cpu_set_bc(struct cpu *cpu, unsigned short bc) {
  unsigned char b = ((unsigned char)(((unsigned short)(bc)) >> 8));
  unsigned char c = ((unsigned char)(((unsigned short)(bc)) >> 0));
  cpu_set_b(cpu, b);
  cpu_set_c(cpu, c);
}


x86 assembly (clang, -O0):
<cpu_set_bc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xb(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xb(%rbp),%esi
call   1040 <cpu_set_b@plt>
mov    -0x8(%rbp),%rdi
movzbl -0xc(%rbp),%esi
call   1030 <cpu_set_c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set_bc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
shr    $0x8,%esi
call   1040 <cpu_set_b@plt>
movzbl %bl,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cpu_set_c@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_set_bc(%struct.cpu* %0, i16 zeroext %1) {
%3 = alloca %struct.cpu*
%4 = alloca i16
%5 = alloca i8
%6 = alloca i8
store %struct.cpu* %0, %struct.cpu** %3
store i16 %1, i16* %4
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 0
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load %struct.cpu*, %struct.cpu** %3
%16 = load i8, i8* %5
%17 = call i32 @cpu_set_b(%struct.cpu* %15, i8 zeroext %16)
%18 = load %struct.cpu*, %struct.cpu** %3
%19 = load i8, i8* %6
%20 = call i32 @cpu_set_c(%struct.cpu* %18, i8 zeroext %19)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_set_bc(%struct.cpu* %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = trunc i16 %1 to i8
%6 = tail call i32 @cpu_set_b(%struct.cpu* %0, i8 zeroext %4)
%7 = tail call i32 @cpu_set_c(%struct.cpu* %0, i8 zeroext %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __getgroupmembership(char const *, int /*<<< orphan*/, int /*<<< orphan*/ *,
                         int, int *);
int getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) {
  return __getgroupmembership(uname, agroup, groups, *grpcnt, grpcnt);
}


x86 assembly (clang, -O0):
<getgrouplist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%r8
call   1030 <__getgroupmembership@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrouplist>:
mov    %rcx,%r8
mov    (%rcx),%ecx
jmp    1030 <__getgroupmembership@plt>

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

LLVM IR (-O2):
define i32 @getgrouplist(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = load i32, i32* %3
%6 = tail call i32 @__getgroupmembership(i8* %0, i32 %1, i32* %2, i32 %5, i32* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int a;
  a = 2;
  {} {{}} { __print_int(111); }
  {
    int b;
    b = 4;
    __print_int(a);
    __print_int(b);
    {
      int c;
      c = 7;
      a = 6;
      __print_int(c);
      __print_int(b);
      __print_int(a);
      return 0;
    }
    a = b;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    $0x6f,%edi
call   1030 <__print_int@plt>
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
movl   $0x7,-0x10(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x8(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6f,%edi
call   1030 <__print_int@plt>
mov    $0x2,%edi
call   1030 <__print_int@plt>
mov    $0x4,%edi
call   1030 <__print_int@plt>
mov    $0x7,%edi
call   1030 <__print_int@plt>
mov    $0x4,%edi
call   1030 <__print_int@plt>
mov    $0x6,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 111)
%2 = tail call i32 @__print_int(i32 2)
%3 = tail call i32 @__print_int(i32 4)
%4 = tail call i32 @__print_int(i32 7)
%5 = tail call i32 @__print_int(i32 4)
%6 = tail call i32 @__print_int(i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _okn_time_init();
int okn_system_init(void) {
  _okn_time_init();
  ;
  return 1;
}


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

x86 assembly (clang, -O2):
<okn_system_init>:
push   %rax
xor    %eax,%eax
call   1030 <_okn_time_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @okn_system_init() {
%1 = tail call i32 (...) @_okn_time_init()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ RETI(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x6d(void) {
  RETI(4, 7);
  T_WAIT_UNTIL(10);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x6d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x7,%esi
call   1040 <RETI@plt>
mov    $0xa,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x6d>:
push   %rax
mov    $0x4,%edi
mov    $0x7,%esi
call   1040 <RETI@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x6d() {
%1 = call i32 @RETI(i32 4, i32 7)
%2 = call i32 @T_WAIT_UNTIL(i32 10)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x6d() {
%1 = tail call i32 @RETI(i32 4, i32 7)
%2 = tail call i32 @T_WAIT_UNTIL(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ansi_free(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<ansi_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ansi_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansi_free>:
test   %rdi,%rdi
je     111a <ansi_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ansi_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ansi_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ eta_tostring(char *, int, long, long, long);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int eta_fprintf(FILE *f, long sec, long done, long total) {
  char buf[1024];
  if (eta_tostring(buf, 1024, sec, done, total) < 0)
    return -1;
  fprintf(f, "%s", buf);
  return 0;
}


x86 assembly (clang, -O0):
<eta_fprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x400,%esi
call   1040 <eta_tostring@plt>
cmp    $0x0,%rax
jge    116e <eta_fprintf+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <eta_fprintf+0x6c>
mov    -0x10(%rbp),%rdi
lea    -0x430(%rbp),%rdx
lea    0xe80(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eta_fprintf>:
push   %rbx
sub    $0x400,%rsp
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <eta_tostring@plt>
test   %rax,%rax
js     1155 <eta_fprintf+0x35>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
xor    %eax,%eax
jmp    115a <eta_fprintf+0x3a>
mov    $0xffffffff,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @eta_fprintf(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca [1024 x i8]
store i32* %0, i32** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = call i64 @eta_tostring(i8* %11, i32 1024, i64 %12, i64 %13, i64 %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %4
store i32 -1, i32* %5
br label %22
18: ; preds = %4
%19 = load i32*, i32** %6
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%21 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %20)
store i32 0, i32* %5
br label %22
22: ; preds = %18, %17
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @eta_fprintf(i32* nocapture %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = call i64 @eta_tostring(i8* %6, i32 1024, i64 %1, i64 %2, i64 %3)
%8 = icmp slt i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i32 @fputs(i8* %6, i32* %0)
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ 0, %9 ], [ -1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ iowrite32(unsigned int, void *);
int /*<<< orphan*/ mb();
void M4U_WriteReg32(unsigned int M4uBase, unsigned int Offset,
                    unsigned int Val) {
  iowrite32(Val, (void *)(M4uBase + Offset));
  mb();
}


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

x86 assembly (clang, -O2):
<M4U_WriteReg32>:
push   %rax
add    %edi,%esi
mov    %edx,%edi
call   1040 <iowrite32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mb@plt>

LLVM IR (-O0):
define void @M4U_WriteReg32(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add i32 %8, %9
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = call i32 @iowrite32(i32 %7, i8* %12)
%14 = call i32 (...) @mb()
ret void
}

LLVM IR (-O2):
define void @M4U_WriteReg32(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @iowrite32(i32 %2, i8* %6)
%8 = tail call i32 (...) @mb()
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};
struct e100_priv_data {
  int dummy;
};

/* Variables and functions */
struct e100_priv_data *netdev_priv(struct net_device *);
int e100_ndo_open(struct net_device *netdev) {
  struct e100_priv_data *data;
  data = netdev_priv(netdev);
  return 0;
}


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

x86 assembly (clang, -O2):
push   %rax
call   1030 <netdev_priv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.net_device = type { i32 }
%struct.e100_priv_data = type { i32 }
define i32 @e100_ndo_open(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
%3 = alloca %struct.e100_priv_data*
store %struct.net_device* %0, %struct.net_device** %2
%4 = load %struct.net_device*, %struct.net_device** %2
%5 = call %struct.e100_priv_data* @netdev_priv(%struct.net_device* %4)
store %struct.e100_priv_data* %5, %struct.e100_priv_data** %3
ret i32 0
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
%struct.e100_priv_data = type { i32 }
define i32 @e100_ndo_open(%struct.net_device* %0) {
%2 = tail call %struct.e100_priv_data* @netdev_priv(%struct.net_device* %0)
ret i32 0
}
/* Variables and functions */
int mlreply(char *, char *, int);
int readin(char *);
int fileread(int f, int n) {
  int s;
  char fname[32];
  if ((s = mlreply("Open file: ", fname, 32)) != 1)
    return (s);
  return (readin(fname));
}


x86 assembly (clang, -O0):
<fileread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x20,%edx
call   1040 <mlreply@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x1,%eax
je     115a <fileread+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <fileread+0x46>
lea    -0x30(%rbp),%rdi
call   1030 <readin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileread>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
mov    $0x20,%edx
call   1040 <mlreply@plt>
cmp    $0x1,%eax
jne    1145 <fileread+0x25>
mov    %rsp,%rdi
call   1030 <readin@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Open file: \00"
define i32 @fileread(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [32 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = call i32 @mlreply(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8, i32 32)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %16
13: ; preds = %2
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%15 = call i32 @readin(i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"Open file: \00"
define i32 @fileread(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @mlreply(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4, i32 32)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @readin(i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
int dtor(double deg, double *rad) {
  static double dtrsr = 1.7463292519943296e-2;
  *rad = deg * dtrsr;
  return 0;
}


x86 assembly (clang, -O0):
<dtor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  0x2f06(%rip),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtor>:
mulsd  0xef8(%rip),%xmm0
movsd  %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@dtor.dtrsr = internal global double 0x3F91E1E5B903B9A6
define i32 @dtor(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double, double* @dtor.dtrsr
%7 = fmul double %5, %6
%8 = load double*, double** %4
store double %7, double* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @dtor(double %0, double* nocapture writeonly %1) {
%3 = fmul double %0, 0x3F91E1E5B903B9A6
store double %3, double* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ gpio_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  gpio_test(0x80000900);
  gpio_test(0x80000a00);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x80000900,%edi
call   1030 <gpio_test@plt>
mov    $0x80000a00,%edi
call   1030 <gpio_test@plt>
mov    $0x0,%al
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x80000900,%edi
call   1030 <gpio_test@plt>
mov    $0x80000a00,%edi
call   1030 <gpio_test@plt>
xor    %eax,%eax
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @gpio_test(i32 -2147481344)
%4 = call i32 @gpio_test(i32 -2147481088)
%5 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @gpio_test(i32 -2147481344)
%4 = tail call i32 @gpio_test(i32 -2147481088)
%5 = tail call i32 (...) @report_end()
ret i32 0
}
/* Variables and functions */
unsigned short _LE_to_BE_short(unsigned short);
unsigned short outw(unsigned short val, int port) {
  *((unsigned short *)(((unsigned long)0x80000000) + port)) =
      _LE_to_BE_short(val);
  return (val);
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <_LE_to_BE_short@plt>
mov    %ax,%cx
movslq -0x8(%rbp),%rax
movabs $0x80000000,%rdx
add    %rdx,%rax
mov    %cx,(%rax)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_LE_to_BE_short@plt>
movslq %ebx,%rcx
mov    $0x80000000,%edx
mov    %ax,(%rcx,%rdx,1)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @outw(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = call zeroext i16 @_LE_to_BE_short(i16 zeroext %5)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add i64 2147483648, %8
%10 = inttoptr i64 %9 to i16*
store i16 %6, i16* %10
%11 = load i16, i16* %3
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @outw(i16 returned zeroext %0, i32 %1) {
%3 = tail call zeroext i16 @_LE_to_BE_short(i16 zeroext %0)
%4 = sext i32 %1 to i64
%5 = add nsw i64 %4, 2147483648
%6 = inttoptr i64 %5 to i16*
store i16 %3, i16* %6
ret i16 %0
}
int test_csinv32_condasn1(int w0, int w1, int w2, int w3) {
  int w4;
  w4 = (w0 == w1) ? ~w2 : w3;
  return w4;
}


x86 assembly (clang, -O0):
<test_csinv32_condasn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    112a <test_csinv32_condasn1+0x2a>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <test_csinv32_condasn1+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csinv32_condasn1>:
mov    %edx,%eax
cmp    %esi,%edi
not    %eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_csinv32_condasn1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i32, i32* %7
%15 = xor i32 %14, -1
br label %18
16: ; preds = %4
%17 = load i32, i32* %8
br label %18
18: ; preds = %16, %13
%19 = phi i32 [ %15, %13 ], [ %17, %16 ]
store i32 %19, i32* %9
%20 = load i32, i32* %9
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_csinv32_condasn1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = xor i32 %2, -1
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
int execute_llistxattr() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_llistxattr() {
ret i32 0
}
/* Variables and functions */
int caca_conio_getch();
int /*<<< orphan*/ caca_conio_printf(char *, int);
int caca_conio_getche(void) {
  int tmp = caca_conio_getch();
  caca_conio_printf("%c", tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<caca_conio_getche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <caca_conio_getch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <caca_conio_printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caca_conio_getche>:
push   %rbx
xor    %eax,%eax
call   1030 <caca_conio_getch@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <caca_conio_printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @caca_conio_getche() {
%1 = tail call i32 (...) @caca_conio_getch()
%2 = tail call i32 @caca_conio_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %1
}
double gmx_cycles_calibrate(double sampletime) { return -1; }


x86 assembly (clang, -O0):
<gmx_cycles_calibrate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_cycles_calibrate>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @gmx_cycles_calibrate(double %0) {
%2 = alloca double
store double %0, double* %2
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @gmx_cycles_calibrate(double %0) {
ret double -1.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
void shuffle_tx_byteorder(uint32_t *v, uint32_t len) {
  while (len--) {
    *v = htonl(*v);
    v++;
  }
}


x86 assembly (clang, -O0):
<shuffle_tx_byteorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1157 <shuffle_tx_byteorder+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <shuffle_tx_byteorder+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shuffle_tx_byteorder>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1146 <shuffle_tx_byteorder+0x36>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <htonl@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1130 <shuffle_tx_byteorder+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @shuffle_tx_byteorder(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 = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = call i32 @htonl(i32 %11)
%13 = load i32*, i32** %3
store i32 %12, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i32 1
store i32* %15, i32** %3
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @shuffle_tx_byteorder(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = load i32, i32* %6
%9 = tail call i32 @htonl(i32 %8)
store i32 %9, i32* %6
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ changeTheString(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *str = "abcd abcde";
  printf("%s", str);
  changeTheString(str);
  printf("%s", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee0(%rip),%r14
lea    0xece(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <changeTheString@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"abcd abcde\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @changeTheString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void setDataInt(unsigned char *data, int i) {
  data[7] = (i >> 24);
  data[6] = ((i << 8) >> 24);
  data[5] = ((i << 16) >> 24);
  data[4] = ((i << 24) >> 24);
}


x86 assembly (clang, -O0):
<setDataInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDataInt>:
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @setDataInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 7
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = shl i32 %10, 8
%12 = ashr i32 %11, 24
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 6
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = shl i32 %16, 16
%18 = ashr i32 %17, 24
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 5
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = shl i32 %22, 24
%24 = ashr i32 %23, 24
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 4
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @setDataInt(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %4, i8* %5
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %12, i8* %13
ret void
}
unsigned fritz(unsigned x) { return x + 1; }


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

x86 assembly (clang, -O2):
<fritz>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fritz(i32 %0) {
%2 = add i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
size_t strlen(char const *);
int strcmpend(const char *str, const char *suffix) {
  const size_t str_len = strlen(str);
  const size_t suf_len = strlen(suffix);
  if (str_len < suf_len)
    return -1;
  return strcmp(str + str_len - suf_len, suffix);
}


x86 assembly (clang, -O0):
<strcmpend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1164 <strcmpend+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <strcmpend+0x61>
mov    -0x10(%rbp),%rdi
add    -0x20(%rbp),%rdi
xor    %eax,%eax
sub    -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmpend>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %rax,%r15
jae    114b <strcmpend+0x2b>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
add    %r15,%rbx
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcmpend(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = sub i64 0, %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ f0(int);
int main() {
  int a;
  if (a > 0) {
    f0(a);
  } else {
    f0(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1136 <main+0x26>
mov    -0x8(%rbp),%edi
call   1030 <f0@plt>
jmp    113d <main+0x2d>
xor    %edi,%edi
call   1030 <f0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f0@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f0(i32 0)
ret i32 0
}
int is_power2(unsigned int val) {
  while (((val & 1) == 0) && (val > 1)) {
    val >>= 1;
  }
  return (val == 1);
}


x86 assembly (clang, -O0):
<is_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1125 <is_power2+0x25>
cmpl   $0x1,-0x4(%rbp)
seta   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1135 <is_power2+0x35>
jmp    1143 <is_power2+0x43>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <is_power2+0x7>
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power2>:
mov    %edi,%ecx
cmp    $0x2,%edi
jb     1114 <is_power2+0x14>
mov    %ecx,%eax
and    $0x1,%eax
mov    %ecx,%edi
shr    %edi
test   %eax,%eax
je     1100 <is_power2>
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %12, %1
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp ugt i32 %8, 1
br label %10
10: ; preds = %7, %3
%11 = phi i1 [ false, %3 ], [ %9, %7 ]
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = load i32, i32* %2
%14 = lshr i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_power2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %8, %2 ]
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = icmp ugt i32 %3, 1
%7 = and i1 %6, %5
%8 = lshr i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
%10 = icmp eq i32 %3, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
char *var_one(char *base) {
  static const unsigned long offset = 1;
  return base + offset;
}


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

x86 assembly (clang, -O2):
<var_one>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
@var_one.offset = internal constant i64 1
define i8* @var_one(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}

LLVM IR (-O2):
define i8* @var_one(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int pthread_spin_destroy(int /*<<< orphan*/ *);
int __attribute__((unused)) ___pthread_spin_destroy(pthread_spinlock_t *spin) {
  return pthread_spin_destroy(spin);
}


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

x86 assembly (clang, -O2):
<___pthread_spin_destroy>:
jmp    1030 <pthread_spin_destroy@plt>

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

LLVM IR (-O2):
define i32 @___pthread_spin_destroy(i32* %0) {
%2 = tail call i32 @pthread_spin_destroy(i32* %0)
ret i32 %2
}
/* Variables and functions */
int get_multiplicity(double **, double **, int const *, int const, double const,
                     double);
int spg_get_multiplicity(double lattice[3][3], double position[][3],
                         const int types[], const int num_atom,
                         const double symprec) {
  return get_multiplicity(lattice, position, types, num_atom, symprec, -1.0);
}


x86 assembly (clang, -O0):
<spg_get_multiplicity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <get_multiplicity@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_multiplicity>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <get_multiplicity@plt>

LLVM IR (-O0):
define i32 @spg_get_multiplicity([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4) {
%6 = alloca [3 x double]*
%7 = alloca [3 x double]*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca double
store [3 x double]* %0, [3 x double]** %6
store [3 x double]* %1, [3 x double]** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load [3 x double]*, [3 x double]** %6
%12 = bitcast [3 x double]* %11 to double**
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load i32*, i32** %8
%16 = load i32, i32* %9
%17 = load double, double* %10
%18 = call i32 @get_multiplicity(double** %12, double** %14, i32* %15, i32 %16, double %17, double -1.000000e+00)
ret i32 %18
}

LLVM IR (-O2):
define i32 @spg_get_multiplicity([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4) {
%6 = bitcast [3 x double]* %0 to double**
%7 = bitcast [3 x double]* %1 to double**
%8 = tail call i32 @get_multiplicity(double** %6, double** %7, i32* %2, i32 %3, double %4, double -1.000000e+00)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ wait_1us(int);
void wait_1ms(unsigned int cnt) {
  unsigned int i;
  for (i = 0; i < cnt; i++)
    wait_1us(1000);
}


x86 assembly (clang, -O0):
<wait_1ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1146 <wait_1ms+0x36>
mov    $0x3e8,%edi
call   1030 <wait_1us@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wait_1ms+0x12>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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