xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void OptickAPI_AttachTag_UInt64(uint64_t inEventDescription, uint64_t inValue) {
}


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

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

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

LLVM IR (-O2):
define void @OptickAPI_AttachTag_UInt64(i32 %0, i32 %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int minor_code;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgraphicsexpose_minor_code(void *_p, int _v) {
  ((XEvent *)_p)->xgraphicsexpose.minor_code = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xgraphicsexpose_minor_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xgraphicsexpose_minor_code(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xgraphicsexpose_minor_code(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct Player {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ act_hold(struct Player *, double);
int /*<<< orphan*/ act_stay(struct Player *, double);
scalar_t__ i_own_ball(struct Player *);
void none_action(struct Player *pp) {
  if (i_own_ball(pp))
    act_hold(pp, 0.0);
  else
    act_stay(pp, 0.0);
}


x86 assembly (clang, -O0):
<none_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <i_own_ball@plt>
cmp    $0x0,%rax
je     1160 <none_action+0x30>
mov    -0x8(%rbp),%rdi
xorps  %xmm0,%xmm0
call   1030 <act_hold@plt>
jmp    116c <none_action+0x3c>
mov    -0x8(%rbp),%rdi
xorps  %xmm0,%xmm0
call   1050 <act_stay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<none_action>:
push   %rbx
mov    %rdi,%rbx
call   1040 <i_own_ball@plt>
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
test   %rax,%rax
je     114a <none_action+0x1a>
pop    %rbx
jmp    1030 <act_hold@plt>
pop    %rbx
jmp    1050 <act_stay@plt>

LLVM IR (-O0):
%struct.Player = type { i32 }
define void @none_action(%struct.Player* %0) {
%2 = alloca %struct.Player*
store %struct.Player* %0, %struct.Player** %2
%3 = load %struct.Player*, %struct.Player** %2
%4 = call i64 @i_own_ball(%struct.Player* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.Player*, %struct.Player** %2
%8 = call i32 @act_hold(%struct.Player* %7, double 0.000000e+00)
br label %12
9: ; preds = %1
%10 = load %struct.Player*, %struct.Player** %2
%11 = call i32 @act_stay(%struct.Player* %10, double 0.000000e+00)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
%struct.Player = type { i32 }
define void @none_action(%struct.Player* %0) {
%2 = tail call i64 @i_own_ball(%struct.Player* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @act_hold(%struct.Player* %0, double 0.000000e+00)
br label %8
6: ; preds = %1
%7 = tail call i32 @act_stay(%struct.Player* %0, double 0.000000e+00)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
char *get_playlist_path();
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ truncate(char *, int /*<<< orphan*/);
int flush_tracks(void) {
  char *path = get_playlist_path();
  if (truncate(path, 0) != 0) {
    printf("(ecaplay) Unable to flush playlist '%s'.\n", path);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<flush_tracks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_playlist_path@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <truncate@plt>
cmp    $0x0,%rax
je     1174 <flush_tracks+0x44>
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <flush_tracks+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_tracks>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <get_playlist_path@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <truncate@plt>
test   %rax,%rax
je     1162 <flush_tracks+0x32>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"(ecaplay) Unable to flush playlist '%s'.\0A\00"
define i32 @flush_tracks() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @get_playlist_path()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @truncate(i8* %4, i32 0)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 -1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [42 x i8] c"(ecaplay) Unable to flush playlist '%s'.\0A\00"
define i32 @flush_tracks() {
%1 = tail call i8* (...) @get_playlist_path()
%2 = tail call i64 @truncate(i8* %1, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ -1, %4 ], [ 0, %0 ]
ret i32 %7
}
unsigned short random_num(void) {
  static unsigned short random_seed;
  random_seed = 28629 * random_seed + 157;
  return random_seed;
}


x86 assembly (clang, -O0):
<random_num>:
push   %rbp
mov    %rsp,%rbp
movzwl 0x2f17(%rip),%eax
imul   $0x6fd5,%eax,%eax
add    $0x9d,%eax
mov    %ax,0x2f05(%rip)
movzwl 0x2efe(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_num>:
movzwl 0x2f1b(%rip),%eax
imul   $0x6fd5,%eax,%eax
add    $0x9d,%eax
mov    %ax,0x2f09(%rip)
ret

LLVM IR (-O0):
@random_num.random_seed = internal global i16 0
define zeroext i16 @random_num() {
%1 = load i16, i16* @random_num.random_seed
%2 = zext i16 %1 to i32
%3 = mul nsw i32 28629, %2
%4 = add nsw i32 %3, 157
%5 = trunc i32 %4 to i16
store i16 %5, i16* @random_num.random_seed
%6 = load i16, i16* @random_num.random_seed
ret i16 %6
}

LLVM IR (-O2):
@random_num.random_seed = internal unnamed_addr global i16 0
define zeroext i16 @random_num() {
%1 = load i16, i16* @random_num.random_seed
%2 = mul i16 %1, 28629
%3 = add i16 %2, 157
store i16 %3, i16* @random_num.random_seed
ret i16 %3
}
void foo17() {}


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

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

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

LLVM IR (-O2):
define void @foo17() {
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int ch) { return isupper(ch) ? ch | 32 : ch; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_create_q();
int /*<<< orphan*/ test_dequeue();
int /*<<< orphan*/ test_enqueue();
int /*<<< orphan*/ test_peek();
int /*<<< orphan*/ test_size();
int main(void) {
  test_create_q();
  test_enqueue();
  test_dequeue();
  test_peek();
  test_size();
  printf("All tests passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_create_q@plt>
mov    $0x0,%al
call   1030 <test_enqueue@plt>
mov    $0x0,%al
call   1080 <test_dequeue@plt>
mov    $0x0,%al
call   1060 <test_peek@plt>
mov    $0x0,%al
call   1040 <test_size@plt>
lea    0xe67(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_create_q@plt>
xor    %eax,%eax
call   1030 <test_enqueue@plt>
xor    %eax,%eax
call   1080 <test_dequeue@plt>
xor    %eax,%eax
call   1060 <test_peek@plt>
xor    %eax,%eax
call   1050 <test_size@plt>
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"All tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_create_q()
%3 = call i32 (...) @test_enqueue()
%4 = call i32 (...) @test_dequeue()
%5 = call i32 (...) @test_peek()
%6 = call i32 (...) @test_size()
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"All tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @test_create_q()
%2 = tail call i32 (...) @test_enqueue()
%3 = tail call i32 (...) @test_dequeue()
%4 = tail call i32 (...) @test_peek()
%5 = tail call i32 (...) @test_size()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float NormalizeAngle(float angle) {
  while (angle < -180.0f)
    angle += 360.0f;
  while (angle > 180.0f)
    angle -= 360.0f;
  return angle;
}


x86 assembly (clang, -O0):
<NormalizeAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <NormalizeAngle+0x32>
movss  0xee5(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1109 <NormalizeAngle+0x9>
jmp    1137 <NormalizeAngle+0x37>
movss  -0x4(%rbp),%xmm0
movss  0xec0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1168 <NormalizeAngle+0x68>
movss  -0x4(%rbp),%xmm0
movss  0xeae(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1137 <NormalizeAngle+0x37>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalizeAngle>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <NormalizeAngle+0x29>
movss  0xeef(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
addss  %xmm2,%xmm0
ucomiss %xmm0,%xmm1
ja     1120 <NormalizeAngle+0x20>
ucomiss 0xed8(%rip),%xmm0
jbe    1159 <NormalizeAngle+0x59>
movss  0xed2(%rip),%xmm1
movss  0xec6(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
ja     1150 <NormalizeAngle+0x50>
ret

LLVM IR (-O0):
define float @NormalizeAngle(float %0) {
%2 = alloca float
store float %0, float* %2
br label %3
3: ; preds = %6, %1
%4 = load float, float* %2
%5 = fcmp olt float %4, -1.800000e+02
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load float, float* %2
%8 = fadd float %7, 3.600000e+02
store float %8, float* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = load float, float* %2
%12 = fcmp ogt float %11, 1.800000e+02
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load float, float* %2
%15 = fsub float %14, 3.600000e+02
store float %15, float* %2
br label %10
16: ; preds = %10
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @NormalizeAngle(float %0) {
%2 = fcmp olt float %0, -1.800000e+02
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi float [ %0, %1 ], [ %8, %6 ]
%5 = fcmp ogt float %4, 1.800000e+02
br i1 %5, label %10, label %14
6: ; preds = %1, %6
%7 = phi float [ %8, %6 ], [ %0, %1 ]
%8 = fadd float %7, 3.600000e+02
%9 = fcmp olt float %8, -1.800000e+02
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi float [ %12, %10 ], [ %4, %3 ]
%12 = fadd float %11, -3.600000e+02
%13 = fcmp ogt float %12, 1.800000e+02
br i1 %13, label %10, label %14
14: ; preds = %10, %3
%15 = phi float [ %4, %3 ], [ %12, %10 ]
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *pname) {
  fprintf(stderr,
          "Usage: %s [-b block size] [ -s cache size] cachedev ssd_devname "
          "disk_devname\n",
          pname);
  fprintf(
      stderr,
      "Usage : %s Default units for -b, -s are sectors, use k/m/g allowed\n",
      pname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xef5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf04(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"Usage: %s [-b block size] [ -s cache size] cachedev ssd_devname disk_devname\0A\00"
@.str.1 = [68 x i8] c"Usage : %s Default units for -b, -s are sectors, use k/m/g allowed\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"Usage: %s [-b block size] [ -s cache size] cachedev ssd_devname disk_devname\0A\00"
@.str.1 = [68 x i8] c"Usage : %s Default units for -b, -s are sectors, use k/m/g allowed\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
double f4_cb_send_float(double (*cb)(float)) {
  float r = 55.0;
  return cb(r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
call   *%rax
movsd  0xed4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_float>:
push   %rax
movss  0xef7(%rip),%xmm0
call   *%rdi
addsd  0xef5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_float(double (float)* %0) {
%2 = alloca double (float)*
%3 = alloca float
store double (float)* %0, double (float)** %2
store float 5.500000e+01, float* %3
%4 = load double (float)*, double (float)** %2
%5 = load float, float* %3
%6 = call double %4(float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_float(double (float)* nocapture %0) {
%2 = tail call double %0(float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ int_compare(int *, int *);
void test_int_compare(void) {
  int a = 4;
  int b = 8;
  int c = 4;
  assert(int_compare(&a, &b) < 0);
  assert(int_compare(&b, &a) > 0);
  assert(int_compare(&a, &c) == 0);
}


x86 assembly (clang, -O0):
<test_int_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <int_compare@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <int_compare@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x4(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <int_compare@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int_compare>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x4,0x14(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x4,0xc(%rsp)
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <int_compare@plt>
shr    $0x3f,%rax
mov    %eax,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <int_compare@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1030 <assert@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1040 <int_compare@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test_int_compare() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 4, i32* %1
store i32 8, i32* %2
store i32 4, i32* %3
%4 = call i64 @int_compare(i32* %1, i32* %2)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i64 @int_compare(i32* %2, i32* %1)
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i64 @int_compare(i32* %1, i32* %3)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @test_int_compare() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 8, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%7 = call i64 @int_compare(i32* %1, i32* %2)
%8 = lshr i64 %7, 63
%9 = trunc i64 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i64 @int_compare(i32* %2, i32* %1)
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i64 @int_compare(i32* %1, i32* %3)
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}
/* Type definitions */
struct kdtree {
  int dummy;
};

/* Variables and functions */
int kd_insert(struct kdtree *, double *, void *);
int kd_insert2(struct kdtree *tree, double x, double y, void *data) {
  double pos[2];
  pos[0] = x;
  pos[1] = y;
  return kd_insert(tree, pos, data);
}


x86 assembly (clang, -O0):
<kd_insert2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <kd_insert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_insert2>:
sub    $0x18,%rsp
mov    %rsi,%rdx
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    %rsp,%rsi
call   1030 <kd_insert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.kdtree = type { i32 }
define i32 @kd_insert2(%struct.kdtree* %0, double %1, double %2, i8* %3) {
%5 = alloca %struct.kdtree*
%6 = alloca double
%7 = alloca double
%8 = alloca i8*
%9 = alloca [2 x double]
store %struct.kdtree* %0, %struct.kdtree** %5
store double %1, double* %6
store double %2, double* %7
store i8* %3, i8** %8
%10 = load double, double* %6
%11 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
store double %10, double* %11
%12 = load double, double* %7
%13 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
store double %12, double* %13
%14 = load %struct.kdtree*, %struct.kdtree** %5
%15 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%16 = load i8*, i8** %8
%17 = call i32 @kd_insert(%struct.kdtree* %14, double* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.kdtree = type { i32 }
define i32 @kd_insert2(%struct.kdtree* %0, double %1, double %2, i8* %3) {
%5 = alloca [2 x double]
%6 = bitcast [2 x double]* %5 to i8*
%7 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
store double %1, double* %7
%8 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
store double %2, double* %8
%9 = call i32 @kd_insert(%struct.kdtree* %0, double* %7, i8* %3)
ret i32 %9
}
void foo() {
  int x, y;
  int u = (y = 2 ? 3 : 0);
  int u_ = ((y = 2) ? 3 : 0);
  int v = (y = (2 ? 3 : 0));
  int s = (2 ? 3 : (y = x));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
int markovschoenfinkelcurryuarchalgorithm(void) {
  char c;
  switch (c) {
  case 0x20:
    break;
  case '.':
    break;
  case '>':
    break;
  case '\"':
    break;
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<markovschoenfinkelcurryuarchalgorithm>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x1(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1e,%eax
ja     1142 <markovschoenfinkelcurryuarchalgorithm+0x42>
mov    -0x10(%rbp),%rax
lea    0xedb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1147 <markovschoenfinkelcurryuarchalgorithm+0x47>
jmp    1147 <markovschoenfinkelcurryuarchalgorithm+0x47>
jmp    1147 <markovschoenfinkelcurryuarchalgorithm+0x47>
jmp    1147 <markovschoenfinkelcurryuarchalgorithm+0x47>
jmp    1147 <markovschoenfinkelcurryuarchalgorithm+0x47>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @markovschoenfinkelcurryuarchalgorithm() {
%1 = alloca i8
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
switch i32 %3, label %8 [
i32 32, label %4
i32 46, label %5
i32 62, label %6
i32 34, label %7
]
4: ; preds = %0
br label %9
5: ; preds = %0
br label %9
6: ; preds = %0
br label %9
7: ; preds = %0
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %7, %6, %5, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @markovschoenfinkelcurryuarchalgorithm() {
ret i32 0
}
extern void *gui_ksys_load_dll(char *path) {
  void *dll_export;
  __asm__ __volatile__("int $0x40"
                       : "=a"(dll_export)
                       : "a"(68), "b"(19), "c"(path));
  return (dll_export);
}


x86 assembly (clang, -O0):
<gui_ksys_load_dll>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0x13,%ebx
int    $0x40
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_load_dll>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0x13,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i8* @gui_ksys_load_dll(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "int $$0x40", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 19, i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @gui_ksys_load_dll(i8* %0) {
%2 = tail call i8* asm sideeffect "int $$0x40", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 19, i8* %0)
ret i8* %2
}
/* Type definitions */
struct ansi_state {
  int dummy;
};
typedef int /*<<< orphan*/ state;

/* Variables and functions */
int /*<<< orphan*/ memset(struct ansi_state *, int, int /*<<< orphan*/);
void ansi_init(struct ansi_state *state) { memset(state, sizeof(state), 0); }


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

x86 assembly (clang, -O2):
<ansi_init>:
mov    $0x8,%esi
xor    %edx,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
%struct.ansi_state = type { i32 }
define void @ansi_init(%struct.ansi_state* %0) {
%2 = tail call i32 @memset(%struct.ansi_state* %0, i32 8, i32 0)
ret void
}
adrx0adr1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((((unsigned short *)10000000)[x0]) <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzwl (%rax,%rcx,2),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1148 <adrx0adr1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <adrx0adr1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = load i16, i16* inttoptr (i64 11111111 to i16*)
%22 = zext i16 %21 to i32
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* inttoptr (i64 11111111 to i16*)
%11 = icmp ule i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
unsigned int imul_lo_op_32(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @imul_lo_op_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @imul_lo_op_32(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void _irq_floppy(void) {
  extern void kjvm_fd_handle();
  kjvm_fd_handle();
  outportb(0x20, 0x20);
}


x86 assembly (clang, -O0):
<_irq_floppy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <kjvm_fd_handle@plt>
mov    $0x20,%esi
mov    %esi,%edi
call   1040 <outportb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_irq_floppy>:
push   %rax
xor    %eax,%eax
call   1030 <kjvm_fd_handle@plt>
mov    $0x20,%edi
mov    $0x20,%esi
pop    %rax
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @_irq_floppy() {
%1 = call i32 @outportb(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @_irq_floppy() {
tail call void (...) @kjvm_fd_handle()
%1 = tail call i32 @outportb(i32 32, i32 32)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_buf_append_9byte(struct cbor_buf *, int, int /*<<< orphan*/);
bool cbor_add_double(struct cbor_buf *buf, double x) {
  union {
    uint64_t n;
    double x;
  } tmp = {.x = x};
  return cbor_buf_append_9byte(buf, 0xfb, tmp.n);
}


x86 assembly (clang, -O0):
<cbor_add_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    $0xfb,%esi
call   1030 <cbor_buf_append_9byte@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_add_double>:
movq   %xmm0,%rdx
mov    $0xfb,%esi
jmp    1030 <cbor_buf_append_9byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
%union.anon = type { double }
define i32 @cbor_add_double(%struct.cbor_buf* %0, double %1) {
%3 = alloca %struct.cbor_buf*
%4 = alloca double
%5 = alloca %union.anon
store %struct.cbor_buf* %0, %struct.cbor_buf** %3
store double %1, double* %4
%6 = bitcast %union.anon* %5 to double*
%7 = load double, double* %4
store double %7, double* %6
%8 = load %struct.cbor_buf*, %struct.cbor_buf** %3
%9 = bitcast %union.anon* %5 to i32*
%10 = load i32, i32* %9
%11 = call i32 @cbor_buf_append_9byte(%struct.cbor_buf* %8, i32 251, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_double(%struct.cbor_buf* %0, double %1) {
%3 = bitcast double %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @cbor_buf_append_9byte(%struct.cbor_buf* %0, i32 251, i32 %4)
ret i32 %5
}
/* Variables and functions */
bool nrf53_errata_4(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_4() {
ret i32 0
}
/* Variables and functions */
char *strchr(char const *, char);
const char *rd_basename(const char *path) {
  const char *t = path;
  const char *t2 = t;
  while ((t = strchr(t, '/')))
    t2 = ++t;
  return t2;
}


x86 assembly (clang, -O0):
<rd_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <rd_basename+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
jmp    112c <rd_basename+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_basename>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
jne    1120 <rd_basename+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @rd_basename(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i8* @strchr(i8* dereferenceable(1) %3, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
int foo3(unsigned a, unsigned b) { return (a >= b); }


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
xor    %eax,%eax
cmp    %esi,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @foo3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp uge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo3(i32 %0, i32 %1) {
%3 = icmp uge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void gencheck_cop1_unusable() {}


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

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

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

LLVM IR (-O2):
define void @gencheck_cop1_unusable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Handle1MsInterrupt();
void SysTick_Handler(void) { Handle1MsInterrupt(); }


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

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

LLVM IR (-O0):
define void @SysTick_Handler() {
%1 = call i32 (...) @Handle1MsInterrupt()
ret void
}

LLVM IR (-O2):
define void @SysTick_Handler() {
%1 = tail call i32 (...) @Handle1MsInterrupt()
ret void
}
int test_imm_CBint8_mem(signed char *val) {
  return ((*val) & (-0xCB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CBint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff35,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CBint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -203
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ comprlib_write_byte(unsigned char);
int comprlib_write_array(unsigned char *buff, int size) {
  int i;
  for (i = 0; i < size; i++) {
    comprlib_write_byte(buff[i]);
  }
  return (i);
}


x86 assembly (clang, -O0):
<comprlib_write_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <comprlib_write_array+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <comprlib_write_byte@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <comprlib_write_array+0x16>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comprlib_write_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <comprlib_write_array+0x35>
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r15,%rbx,1),%edi
call   1030 <comprlib_write_byte@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <comprlib_write_array+0x20>
jmp    1148 <comprlib_write_array+0x38>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @comprlib_write_array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @comprlib_write_byte(i8 zeroext %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @comprlib_write_array(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @comprlib_write_byte(i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %1, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void msort(int *array, int low, int high) {
  if (low < high) {
    int mid = (low + high) / 2;
    msort(array, low, mid);
    msort(array, mid + 1, high);
    merge(array, low, mid, high);
  }
  return;
}


x86 assembly (clang, -O0):
<msort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <msort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <msort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <msort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msort>:
cmp    %edx,%esi
jge    1172 <msort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <msort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <msort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @msort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @msort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @msort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @msort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ eputc(unsigned int);
void write32bit(unsigned long data) {
  eputc((unsigned)((data >> 24) & 0xff));
  eputc((unsigned)((data >> 16) & 0xff));
  eputc((unsigned)((data >> 8) & 0xff));
  eputc((unsigned)(data & 0xff));
}


x86 assembly (clang, -O0):
<write32bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %eax,%edi
call   1030 <eputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32bit>:
push   %rbx
mov    %rdi,%rbx
mov    %ebx,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <eputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <eputc@plt>
movzbl %bh,%edi
call   1030 <eputc@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <eputc@plt>

LLVM IR (-O0):
define void @write32bit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 255
%6 = trunc i64 %5 to i32
%7 = call i32 @eputc(i32 %6)
%8 = load i64, i64* %2
%9 = lshr i64 %8, 16
%10 = and i64 %9, 255
%11 = trunc i64 %10 to i32
%12 = call i32 @eputc(i32 %11)
%13 = load i64, i64* %2
%14 = lshr i64 %13, 8
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i32
%17 = call i32 @eputc(i32 %16)
%18 = load i64, i64* %2
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i32
%21 = call i32 @eputc(i32 %20)
ret void
}

LLVM IR (-O2):
define void @write32bit(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 24
%4 = tail call i32 @eputc(i32 %3)
%5 = lshr i32 %2, 16
%6 = and i32 %5, 255
%7 = tail call i32 @eputc(i32 %6)
%8 = lshr i32 %2, 8
%9 = and i32 %8, 255
%10 = tail call i32 @eputc(i32 %9)
%11 = and i32 %2, 255
%12 = tail call i32 @eputc(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g12_cb(void *arg) { puts("GPIO_12 triggered"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"GPIO_12 triggered\00"
define void @g12_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"GPIO_12 triggered\00"
define void @g12_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
int integrity_inode_alloc(struct inode *inode) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @integrity_inode_alloc(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @integrity_inode_alloc(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ __sigemptyset(int /*<<< orphan*/ *);
int sigemptyset(sigset_t *set) {
  __sigemptyset(set);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sigemptyset(i32* %0) {
%2 = tail call i32 @__sigemptyset(i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Cbuf_InsertText(int /*<<< orphan*/);
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Cvar_String(int /*<<< orphan*/);
void Cmd_VStr_f(void) {
  if (Cmd_Argc() != 2)
    Com_Printf("vstr <variable> : execute a variable command\n");
  else
    Cbuf_InsertText(Cvar_String(Cmd_Argv(1)));
}


x86 assembly (clang, -O0):
<Cmd_VStr_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     1175 <Cmd_VStr_f+0x25>
lea    0xe95(%rip),%rdi
call   1060 <Com_Printf@plt>
jmp    118d <Cmd_VStr_f+0x3d>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <Cvar_String@plt>
mov    %eax,%edi
call   1050 <Cbuf_InsertText@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_VStr_f>:
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    1176 <Cmd_VStr_f+0x26>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <Cvar_String@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <Cbuf_InsertText@plt>
lea    0xe83(%rip),%rdi
pop    %rax
jmp    1060 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"vstr <variable> : execute a variable command\0A\00"
define void @Cmd_VStr_f() {
%1 = call i32 (...) @Cmd_Argc()
%2 = icmp ne i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @Cmd_Argv(i32 1)
%7 = call i32 @Cvar_String(i32 %6)
%8 = call i32 @Cbuf_InsertText(i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"vstr <variable> : execute a variable command\0A\00"
define void @Cmd_VStr_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i32 @Cvar_String(i32 %6)
%8 = tail call i32 @Cbuf_InsertText(i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}