xunge/DecIR huggingface dataset:
float sgn(float a) {
  if (a > 0.0f)
    return 1.0f;
  if (a < 0.0f)
    return -1.0f;
  return 0.0f;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    112c <sgn+0x2c>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <sgn+0x53>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    114b <sgn+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <sgn+0x53>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpltss %xmm1,%xmm2
movss  0xeed(%rip),%xmm3
andps  %xmm2,%xmm3
cmpltss %xmm0,%xmm1
movss  0xee1(%rip),%xmm0
andps  %xmm1,%xmm0
andnps %xmm3,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sgn(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp olt float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store float -1.000000e+00, float* %2
br label %12
11: ; preds = %7
store float 0.000000e+00, float* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @sgn(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float -1.000000e+00, float 0.000000e+00
%5 = select i1 %2, float 1.000000e+00, float %4
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t LittleToHostEndian32(const uint32_t In) { return In; }


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

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

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

LLVM IR (-O2):
define i32 @LittleToHostEndian32(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ unlink(char *);
void remove_pidfile(char *pid_file) {
  if (!pid_file)
    return;
  if (unlink(pid_file)) {
    fprintf(stderr, "Could not remove the pid file %s.\n", pid_file);
  }
}


x86 assembly (clang, -O0):
<remove_pidfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <remove_pidfile+0x1c>
jmp    1168 <remove_pidfile+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1168 <remove_pidfile+0x48>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_pidfile>:
push   %rbx
test   %rdi,%rdi
je     114c <remove_pidfile+0x2c>
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %rax,%rax
je     114c <remove_pidfile+0x2c>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Could not remove the pid file %s.\0A\00"
define void @remove_pidfile(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 %6, label %5
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @unlink(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %5, %10, %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Could not remove the pid file %s.\0A\00"
define void @remove_pidfile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @unlink(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %1, %6, %3
ret void
}
int qcom_glink_driver_register(void *drv) {}


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

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

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

LLVM IR (-O2):
define i32 @qcom_glink_driver_register(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test3function();
int main() {
  test3function();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test3function()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test3function()
ret i32 0
}
void get_my_loop_start_and_end(int size, int *start, int *end) {
  *start = 0;
  *end = size;
}


x86 assembly (clang, -O0):
<get_my_loop_start_and_end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_my_loop_start_and_end>:
movl   $0x0,(%rsi)
mov    %edi,(%rdx)
ret

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

LLVM IR (-O2):
define void @get_my_loop_start_and_end(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %1
store i32 %0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *, char *);
int /*<<< orphan*/ stderr;
int yyerror(char *s) {
  extern int yylineno;
  extern char yytext[];
  fprintf(stderr, "Syntax error on line %d, found \"%s\" (\"%s\").\n", yylineno,
          yytext, s);
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%r8
lea    0xeb7(%rip),%rsi
mov    0x2e80(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%r8
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xec3(%rip),%rsi
mov    0x2e8c(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Syntax error on line %d, found \22%s\22 (\22%s\22).\0A\00"
@yylineno = external global i32
@yytext = external global [0 x i8]
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* @yylineno
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @yytext, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Syntax error on line %d, found \22%s\22 (\22%s\22).\0A\00"
@yylineno = external global i32
@yytext = external global [0 x i8]
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @yylineno
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @yytext, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void foo_long(signed long x, unsigned long y) {
  long t = (((x) >= 0) ? (x) : -(x));
  if (t != y)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1138 <foo_long+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1142 <foo_long+0x32>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     115d <foo_long+0x4d>
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_long>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
cmp    %rsi,%rax
jne    1120 <foo_long+0x10>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %13
10: ; preds = %2
%11 = load i64, i64* %3
%12 = sub nsw i64 0, %11
br label %13
13: ; preds = %10, %8
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %4
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13
unreachable
19: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @foo_long(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%4 = icmp eq i64 %3, %1
br i1 %4, label %6, label %5
5: ; preds = %2
tail call void @abort()
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int read(int, unsigned char *, int);
int fgetc(int fd) {
  unsigned char c;
  while (read(fd, &c, 1) != 1)
    ;
  return c;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     113a <fgetc+0x2a>
jmp    111b <fgetc+0xb>
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1120 <fgetc+0x10>
movzbl 0x7(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @fgetc(i32 %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i32 @read(i32 %0, i8* %2, i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
ret i32 %8
}
void unquote(char *s) {
  char *p;
  if (*s != '\\')
    return;
  for (p = s; *p; p++)
    *p = *(p + 1);
}


x86 assembly (clang, -O0):
<unquote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     111d <unquote+0x1d>
jmp    1150 <unquote+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <unquote+0x50>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1125 <unquote+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unquote>:
cmpb   $0x5c,(%rdi)
jne    111e <unquote+0x1e>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%eax
mov    %al,-0x1(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1110 <unquote+0x10>
ret

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

LLVM IR (-O2):
define void @unquote(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 92
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_cmovne_imm(int, int);
int /*<<< orphan*/ emit_movs(int, int);
int /*<<< orphan*/ emit_test(int, int);
void emit_set_nz32(int rs, int rt) {
  if (rs != rt)
    emit_movs(rs, rt);
  else
    emit_test(rs, rs);
  emit_cmovne_imm(1, rt);
}


x86 assembly (clang, -O0):
<emit_set_nz32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     115a <emit_set_nz32+0x2a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <emit_movs@plt>
jmp    1165 <emit_set_nz32+0x35>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <emit_test@plt>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1040 <emit_cmovne_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_set_nz32>:
push   %rbx
mov    %esi,%ebx
cmp    %esi,%edi
jne    1140 <emit_set_nz32+0x10>
mov    %edi,%esi
call   1050 <emit_test@plt>
jmp    1147 <emit_set_nz32+0x17>
mov    %ebx,%esi
call   1030 <emit_movs@plt>
mov    $0x1,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <emit_cmovne_imm@plt>

LLVM IR (-O0):
define void @emit_set_nz32(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 ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @emit_movs(i32 %9, i32 %10)
br label %16
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @emit_test(i32 %13, i32 %14)
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %4
%18 = call i32 @emit_cmovne_imm(i32 1, i32 %17)
ret void
}

LLVM IR (-O2):
define void @emit_set_nz32(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @emit_movs(i32 %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @emit_test(i32 %0, i32 %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @emit_cmovne_imm(i32 1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNd_print(double const *, int);
void vec4d_print(const double v[4]) { vecNd_print(v, 4); }


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

x86 assembly (clang, -O2):
<vec4d_print>:
mov    $0x4,%esi
jmp    1030 <vecNd_print@plt>

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

LLVM IR (-O2):
define void @vec4d_print(double* %0) {
%2 = tail call i32 @vecNd_print(double* %0, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __setxid(int, int, int /*<<< orphan*/, int);
int setegid(gid_t egid) { return __setxid(170, -1, egid, -1); }


x86 assembly (clang, -O0):
<setegid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xaa,%edi
mov    $0xffffffff,%ecx
mov    %ecx,%esi
call   1030 <__setxid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setegid>:
mov    %edi,%edx
mov    $0xaa,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%ecx
jmp    1030 <__setxid@plt>

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

LLVM IR (-O2):
define i32 @setegid(i32 %0) {
%2 = tail call i32 @__setxid(i32 170, i32 -1, i32 %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int flock(int, int /*<<< orphan*/);
int UNlock(int fd) { return flock(fd, LOCK_UN); }


x86 assembly (clang, -O0):
<UNlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UNlock>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_UN = global i32 0
define i32 @UNlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_UN
%5 = call i32 @flock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@LOCK_UN = global i32 0
define i32 @UNlock(i32 %0) {
%2 = load i32, i32* @LOCK_UN
%3 = tail call i32 @flock(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned char PDCRead(int);
unsigned char PDCLEDRead(void) { return (PDCRead(0x5)); }


x86 assembly (clang, -O0):
<PDCLEDRead>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <PDCRead@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDCLEDRead>:
mov    $0x5,%edi
jmp    1030 <PDCRead@plt>

LLVM IR (-O0):
define zeroext i8 @PDCLEDRead() {
%1 = call zeroext i8 @PDCRead(i32 5)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @PDCLEDRead() {
%1 = tail call zeroext i8 @PDCRead(i32 5)
ret i8 %1
}
long test_long_9(long a, long b, long c, long d, long e, long f, long g, long h,
                 long i) {
  return a * b * c * d * e * f * g * h * i;
}


x86 assembly (clang, -O0):
<test_long_9>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
imul   -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
imul   -0x30(%rbp),%rax
imul   0x10(%rbp),%rax
imul   0x18(%rbp),%rax
imul   0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_9>:
mov    %r8,%rax
imul   %rsi,%rdi
imul   %rcx,%rdx
imul   %rdi,%rdx
imul   %r9,%rax
imul   %rdx,%rax
imul   0x8(%rsp),%rax
imul   0x10(%rsp),%rax
imul   0x18(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @test_long_9(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8) {
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %10
store i64 %1, i64* %11
store i64 %2, i64* %12
store i64 %3, i64* %13
store i64 %4, i64* %14
store i64 %5, i64* %15
store i64 %6, i64* %16
store i64 %7, i64* %17
store i64 %8, i64* %18
%19 = load i64, i64* %10
%20 = load i64, i64* %11
%21 = mul nsw i64 %19, %20
%22 = load i64, i64* %12
%23 = mul nsw i64 %21, %22
%24 = load i64, i64* %13
%25 = mul nsw i64 %23, %24
%26 = load i64, i64* %14
%27 = mul nsw i64 %25, %26
%28 = load i64, i64* %15
%29 = mul nsw i64 %27, %28
%30 = load i64, i64* %16
%31 = mul nsw i64 %29, %30
%32 = load i64, i64* %17
%33 = mul nsw i64 %31, %32
%34 = load i64, i64* %18
%35 = mul nsw i64 %33, %34
ret i64 %35
}

LLVM IR (-O2):
define i64 @test_long_9(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8) {
%10 = mul nsw i64 %1, %0
%11 = mul nsw i64 %10, %2
%12 = mul nsw i64 %11, %3
%13 = mul nsw i64 %12, %4
%14 = mul nsw i64 %13, %5
%15 = mul nsw i64 %14, %6
%16 = mul nsw i64 %15, %7
%17 = mul nsw i64 %16, %8
ret i64 %17
}
int GridX(int x) { return (x >> 4) << 4; }


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

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

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

LLVM IR (-O2):
define i32 @GridX(i32 %0) {
%2 = and i32 %0, -16
ret i32 %2
}
void write(int *p) { *p = 1; }


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

x86 assembly (clang, -O2):
<write>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @write(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
unsigned char truncate(float f) {
  if (f > 255.0)
    return 255;
  else if (f < 0)
    return 0;
  else
    return (unsigned char)(f / 1);
}


x86 assembly (clang, -O0):
<truncate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <truncate+0x2d>
movb   $0xff,-0x1(%rbp)
jmp    114b <truncate+0x4b>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1143 <truncate+0x43>
movb   $0x0,-0x1(%rbp)
jmp    114b <truncate+0x4b>
cvttss2si -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate>:
mov    $0xff,%al
ucomiss 0xef7(%rip),%xmm0
ja     111a <truncate+0x1a>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1116 <truncate+0x16>
xor    %eax,%eax
ret
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i8 @truncate(float %0) {
%2 = alloca i8
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 2.550000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 -1, i8* %2
br label %16
8: ; preds = %1
%9 = load float, float* %3
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store i8 0, i8* %2
br label %16
12: ; preds = %8
%13 = load float, float* %3
%14 = fdiv float %13, 1.000000e+00
%15 = fptoui float %14 to i8
store i8 %15, i8* %2
br label %16
16: ; preds = %12, %11, %7
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @truncate(float %0) {
%2 = fcmp ogt float %0, 2.550000e+02
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp olt float %0, 0.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fptoui float %0 to i8
br label %7
7: ; preds = %3, %1, %5
%8 = phi i8 [ %6, %5 ], [ -1, %1 ], [ 0, %3 ]
ret i8 %8
}
/* Variables and functions */
int f156(int *);
int f157(int *p) { return f156(p); }


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

x86 assembly (clang, -O2):
<f157>:
jmp    1030 <f156@plt>

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

LLVM IR (-O2):
define i32 @f157(i32* %0) {
%2 = tail call i32 @f156(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void fatal(char *msg) {
  fprintf(stdout, "%s\n", msg);
  exit(-2);
}


x86 assembly (clang, -O0):
<fatal>:
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    $0xfffffffe,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -2)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ RET(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xc9(void) {
  RET(4, 7);
  T_WAIT_UNTIL(10);
  return;
}


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

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

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

LLVM IR (-O2):
define void @op_0xc9() {
%1 = tail call i32 @RET(i32 4, i32 7)
%2 = tail call i32 @T_WAIT_UNTIL(i32 10)
ret void
}
/* Variables and functions */
int potencia(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("2 elevado a 5: %d", potencia(2, 5));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"2 elevado a 5: %d\00"
define i32 @main() {
%1 = tail call i32 @potencia(i32 2, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int, int *);
int main(void) {
  int a[16 + 1] __attribute__((__aligned__(16)));
  check_vect();
  main1(16, a + 1);
  main1(0, a + 1);
  main1(1, a + 1);
  main1(2, a + 1);
  main1(16 - 1, a + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
lea    -0x50(%rbp),%rsi
add    $0x4,%rsi
mov    $0x10,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
add    $0x4,%rsi
xor    %edi,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
add    $0x4,%rsi
mov    $0x1,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
add    $0x4,%rsi
mov    $0x2,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
add    $0x4,%rsi
mov    $0xf,%edi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
xor    %eax,%eax
call   1030 <check_vect@plt>
lea    0x4(%rsp),%rbx
mov    $0x10,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
mov    $0xf,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i32]
store i32 0, i32* %1
%3 = call i32 (...) @check_vect()
%4 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = call i32 @main1(i32 16, i32* %5)
%7 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = call i32 @main1(i32 0, i32* %8)
%10 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = call i32 @main1(i32 1, i32* %11)
%13 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = call i32 @main1(i32 2, i32* %14)
%16 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = call i32 @main1(i32 15, i32* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [17 x i32]
%2 = bitcast [17 x i32]* %1 to i8*
%3 = tail call i32 (...) @check_vect()
%4 = getelementptr inbounds [17 x i32], [17 x i32]* %1, i64 0, i64 1
%5 = call i32 @main1(i32 16, i32* %4)
%6 = call i32 @main1(i32 0, i32* %4)
%7 = call i32 @main1(i32 1, i32* %4)
%8 = call i32 @main1(i32 2, i32* %4)
%9 = call i32 @main1(i32 15, i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M231_f(char *s) {
  debug("M231_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<M231_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M231_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M231_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M231_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M231_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ foo2();
void foo3(void) { foo2(); }


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

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

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

LLVM IR (-O2):
define void @foo3() {
%1 = tail call i32 (...) @foo2()
ret void
}
void roadmap_start_export_data(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_start_export_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__5__IO__set();
void CC2420ControlP__VREN__set(void) { HplAtm128GeneralIOPinP__5__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__VREN__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__5__IO__set()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t seg_alloc(void) {
  static int32_t next_seg = 0;
  int32_t this_seg = next_seg;
  next_seg += 2;
  return this_seg;
}


x86 assembly (clang, -O0):
<seg_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f11(%rip),%eax
add    $0x2,%eax
mov    %eax,0x2f08(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seg_alloc>:
mov    0x2f1e(%rip),%eax
lea    0x2(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@seg_alloc.next_seg = internal global i32 0
define i32 @seg_alloc() {
%1 = alloca i32
%2 = load i32, i32* @seg_alloc.next_seg
store i32 %2, i32* %1
%3 = load i32, i32* @seg_alloc.next_seg
%4 = add nsw i32 %3, 2
store i32 %4, i32* @seg_alloc.next_seg
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@seg_alloc.next_seg = internal unnamed_addr global i32 0
define i32 @seg_alloc() {
%1 = load i32, i32* @seg_alloc.next_seg
%2 = add nsw i32 %1, 2
store i32 %2, i32* @seg_alloc.next_seg
ret i32 %1
}
/* Variables and functions */
int test_svarint(int);
char *test_svarint1() {
  do {
    if (!(test_svarint(0x26) == 19))
      return "error, test_svarint1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_svarint1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x26,%edi
call   1030 <test_svarint@plt>
cmp    $0x13,%eax
je     113b <test_svarint1+0x2b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <test_svarint1+0x38>
jmp    1140 <test_svarint1+0x30>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_svarint1>:
push   %rax
mov    $0x26,%edi
call   1030 <test_svarint@plt>
xor    %ecx,%ecx
cmp    $0x13,%eax
lea    0xed9(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"error, test_svarint1\00"
define i8* @test_svarint1() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @test_svarint(i32 38)
%4 = icmp eq i32 %3, 19
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [21 x i8] c"error, test_svarint1\00"
define i8* @test_svarint1() {
%1 = tail call i32 @test_svarint(i32 38)
%2 = icmp eq i32 %1, 19
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t rgb565expand(uint16_t color0) {
  return ((color0 & 0xF800) << 16) | ((color0 & 0x07E0) << 13) |
         ((color0 & 0x001F) << 11) | 0xFF;
}


x86 assembly (clang, -O0):
<rgb565expand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf800,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0x7e0,%ecx
shl    $0xd,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
shl    $0xb,%ecx
or     %ecx,%eax
or     $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb565expand>:
mov    %edi,%eax
shl    $0x10,%eax
and    $0xf8000000,%eax
mov    %edi,%ecx
shl    $0xd,%ecx
and    $0xfc0000,%ecx
or     %eax,%ecx
shl    $0xb,%edi
movzwl %di,%eax
add    %ecx,%eax
add    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @rgb565expand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 63488
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = and i32 %6, 2016
%8 = shl i32 %7, 13
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 31
%12 = shl i32 %11, 11
%13 = or i32 %9, %12
%14 = or i32 %13, 255
ret i32 %14
}

LLVM IR (-O2):
define i32 @rgb565expand(i32 %0) {
%2 = shl i32 %0, 16
%3 = and i32 %2, -134217728
%4 = shl i32 %0, 13
%5 = and i32 %4, 16515072
%6 = shl i32 %0, 11
%7 = and i32 %6, 63488
%8 = or i32 %5, %3
%9 = or i32 %8, %7
%10 = or i32 %9, 255
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ rt_init();
__attribute__((constructor)) void initializer() { rt_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initializer, i8* null }]
define void @initializer() {
%1 = call i32 (...) @rt_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initializer, i8* null }]
define void @initializer() {
%1 = tail call i32 (...) @rt_init()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int char_to_hex(int /*<<< orphan*/);
int /*<<< orphan*/ uart_get();
uint8_t read_label() {
  const uint8_t c1 = char_to_hex(uart_get());
  const uint8_t c2 = char_to_hex(uart_get());
  return ((c1 << 4) | c2);
}


x86 assembly (clang, -O0):
<read_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <uart_get@plt>
mov    %eax,%edi
call   1040 <char_to_hex@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <uart_get@plt>
mov    %eax,%edi
call   1040 <char_to_hex@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_label>:
push   %rbx
xor    %eax,%eax
call   1030 <uart_get@plt>
mov    %eax,%edi
call   1040 <char_to_hex@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <uart_get@plt>
mov    %eax,%edi
call   1040 <char_to_hex@plt>
shl    $0x4,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_label() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @uart_get()
%4 = call i32 @char_to_hex(i32 %3)
store i32 %4, i32* %1
%5 = call i32 (...) @uart_get()
%6 = call i32 @char_to_hex(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = shl i32 %7, 4
%9 = load i32, i32* %2
%10 = or i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @read_label() {
%1 = tail call i32 (...) @uart_get()
%2 = tail call i32 @char_to_hex(i32 %1)
%3 = tail call i32 (...) @uart_get()
%4 = tail call i32 @char_to_hex(i32 %3)
%5 = shl i32 %2, 4
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x13() {
  Assert_real((isodigit(19) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              100, ("isodigit should be 0 for 0x13"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x13>:
push   %rax
mov    $0x13,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x64,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x13\00"
define void @t_isodigit_0x13() {
%1 = call i64 @isodigit(i32 19)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x13\00"
define void @t_isodigit_0x13() {
%1 = tail call i64 @isodigit(i32 19)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __crow_f2();
int expect(int, int /*<<< orphan*/);
int test_f2() { return expect(3, __crow_f2()); }


x86 assembly (clang, -O0):
<test_f2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__crow_f2@plt>
mov    %eax,%esi
mov    $0x3,%edi
call   1040 <expect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_f2>:
push   %rax
xor    %eax,%eax
call   1030 <__crow_f2@plt>
mov    $0x3,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <expect@plt>

LLVM IR (-O0):
define i32 @test_f2() {
%1 = call i32 (...) @__crow_f2()
%2 = call i32 @expect(i32 3, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_f2() {
%1 = tail call i32 (...) @__crow_f2()
%2 = tail call i32 @expect(i32 3, i32 %1)
ret i32 %2
}
void board_gpio_init(const struct ts_platform_data *pdata) {}


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

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

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

LLVM IR (-O2):
%struct.ts_platform_data = type opaque
define void @board_gpio_init(%struct.ts_platform_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PathPlanHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PathPlanUpdated() { UAVObjUpdated(PathPlanHandle()); }


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

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

LLVM IR (-O0):
define void @PathPlanUpdated() {
%1 = call i32 (...) @PathPlanHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathPlanUpdated() {
%1 = tail call i32 (...) @PathPlanHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
unsigned char ldb(unsigned char *p) { return p[7]; }


x86 assembly (clang, -O0):
<ldb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldb>:
mov    0x7(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @ldb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @ldb(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int is_bzipped(char *name) {
  int len = strlen(name);
  return len >= 5 && strcmp(&name[len - 4], ".bz2") == 0;
}


x86 assembly (clang, -O0):
<is_bzipped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x5,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     116c <is_bzipped+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
cltq
add    %rax,%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bzipped>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
jl     1152 <is_bzipped+0x32>
add    $0xfffffffc,%ecx
add    %rcx,%rbx
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c".bz2\00"
define i32 @is_bzipped(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 5
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br label %16
16: ; preds = %8, %1
%17 = phi i1 [ false, %1 ], [ %15, %8 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c".bz2\00"
define i32 @is_bzipped(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 4
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -4
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %12
}
void sound_init() { return; }


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

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

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

LLVM IR (-O2):
define void @sound_init() {
ret void
}
void Mixer_StartChannel(int channel) {}


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

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

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

LLVM IR (-O2):
define void @Mixer_StartChannel(i32 %0) {
ret void
}
/* Variables and functions */
int CreateSocket();
int main() {
  int ret;
  ret = CreateSocket();
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @CreateSocket()
ret i32 %1
}