xunge/DecIR huggingface dataset:
unsigned int sax_hash(const char *key) {
  unsigned int h = 0;
  while (*key)
    h ^= (h << 5) + (h >> 2) + (unsigned char)*key++;
  return h;
}


x86 assembly (clang, -O0):
<sax_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <sax_hash+0x49>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sax_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sax_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <sax_hash+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
mov    %eax,%esi
shr    $0x2,%esi
add    %edx,%esi
movzbl %cl,%ecx
add    %esi,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sax_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sax_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %14, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 5
%9 = lshr i32 %6, 2
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = zext i8 %5 to i32
%13 = add i32 %10, %12
%14 = xor i32 %13, %6
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i32 [ 0, %1 ], [ %14, %4 ]
ret i32 %18
}
int main(void) {
  int ten = 10, twenty = 20;
  return (ten > twenty) + (ten > twenty) + (twenty > ten);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp sgt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int ioDisableFileAccess();
int secDisableFileAccess(void) { return ioDisableFileAccess(); }


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

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

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

LLVM IR (-O2):
define i32 @secDisableFileAccess() {
%1 = tail call i32 (...) @ioDisableFileAccess()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ buf_int(char *, int);
int player_get_buffer_chunks();
void get_buffer_seconds(unsigned int id, char *buf) {
  buf_int(buf, (player_get_buffer_chunks() * (60 * 1024) +
                (44100 * 16 / 8 * 2) / 2) /
                   (44100 * 16 / 8 * 2));
}


x86 assembly (clang, -O0):
<get_buffer_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <player_get_buffer_chunks@plt>
mov    -0x18(%rbp),%rdi
imul   $0xf000,%eax,%eax
add    $0x15888,%eax
mov    $0x2b110,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1040 <buf_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_buffer_seconds>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <player_get_buffer_chunks@plt>
imul   $0xf000,%eax,%eax
add    $0x15888,%eax
cltq
imul   $0x2f8df18f,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x2f,%rsi
add    %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <buf_int@plt>

LLVM IR (-O0):
define void @get_buffer_seconds(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (...) @player_get_buffer_chunks()
%7 = mul nsw i32 %6, 61440
%8 = add nsw i32 %7, 88200
%9 = sdiv i32 %8, 176400
%10 = call i32 @buf_int(i8* %5, i32 %9)
ret void
}

LLVM IR (-O2):
define void @get_buffer_seconds(i32 %0, i8* %1) {
%3 = tail call i32 (...) @player_get_buffer_chunks()
%4 = mul nsw i32 %3, 61440
%5 = add nsw i32 %4, 88200
%6 = sdiv i32 %5, 176400
%7 = tail call i32 @buf_int(i8* %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ST7735_OutString(char *);
void LCD_OutString(char *ptr) { ST7735_OutString(ptr); }


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

x86 assembly (clang, -O2):
<LCD_OutString>:
jmp    1030 <ST7735_OutString@plt>

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

LLVM IR (-O2):
define void @LCD_OutString(i8* %0) {
%2 = tail call i32 @ST7735_OutString(i8* %0)
ret void
}
/* Variables and functions */
int copysignf(int, float);
int isMinusZerof(float x) { return x == 0 && copysignf(1, x) == -1; }


x86 assembly (clang, -O0):
<isMinusZerof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jne    1151 <isMinusZerof+0x41>
jp     1151 <isMinusZerof+0x41>
movss  -0x4(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <copysignf@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMinusZerof>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1134 <isMinusZerof+0x24>
jp     1134 <isMinusZerof+0x24>
push   %rax
mov    $0x1,%edi
call   1030 <copysignf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isMinusZerof(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load float, float* %2
%7 = call i32 @copysignf(i32 1, float %6)
%8 = icmp eq i32 %7, -1
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isMinusZerof(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @copysignf(i32 1, float %0)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3(
    int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41(
    __m128i *in_3_v16i_current_r_g_b_vectors,
    __m128i *in_3_v16i_previous_r_g_b_vectors,
    __m128i *out_3_v16i_avg_422_r_g_b_vectors) {
  avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3(
      in_3_v16i_current_r_g_b_vectors, in_3_v16i_previous_r_g_b_vectors,
      out_3_v16i_avg_422_r_g_b_vectors);
}


x86 assembly (clang, -O0):
<avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41>:
jmp    1030 <avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3@plt>

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

LLVM IR (-O2):
define void @avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @avg_422_downsample_r_g_b_vectors_n_save_previous_sse2_ssse3(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
void formatted_string(const char *pszFormat, va_list args) {
  char szErrStr[512];
  vsnprintf(szErrStr, 512, pszFormat, args);
  fprintf(stderr, "%s\n", szErrStr);
}


x86 assembly (clang, -O0):
<formatted_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x200,%esi
call   1030 <vsnprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x210(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formatted_string>:
push   %rbx
sub    $0x200,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <vsnprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @formatted_string(i8* nocapture %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 512, i8* %0, i32 %1)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _usage(char *name) {
  printf("Usage: %s \\\n"
         "        --keystore <keystore> \\\n"
         "        --role <keyid.role> --principal <keyid>\n"
         "        --dump <file>\n"
         "    loads the keystore and runs the query role <-?- principal\n",
         name);
  exit(1);
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [177 x i8] c"Usage: %s \\\0A --keystore <keystore> \\\0A --role <keyid.role> --principal <keyid>\0A --dump <file>\0A loads the keystore and runs the query role <-?- principal\0A\00"
define void @_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [177 x i8] c"Usage: %s \\\0A --keystore <keystore> \\\0A --role <keyid.role> --principal <keyid>\0A --dump <file>\0A loads the keystore and runs the query role <-?- principal\0A\00"
define void @_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *jsonZcbString(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *jsonZcbVersion(int major, int minor) {
  char buf[20];
  sprintf(buf, "r%d.%d", major, minor);
  return (jsonZcbString("version", buf));
}


x86 assembly (clang, -O0):
<jsonZcbVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <jsonZcbString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonZcbVersion>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <jsonZcbString@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"r%d.%d\00"
@.str.1 = [8 x i8] c"version\00"
define i8* @jsonZcbVersion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%11 = call i8* @jsonZcbString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"r%d.%d\00"
@.str.1 = [8 x i8] c"version\00"
define i8* @jsonZcbVersion(i32 %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i8* @jsonZcbString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void err_handler(char *msg) { fprintf(stderr, "Error : %s\n", msg); }


x86 assembly (clang, -O0):
<err_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_handler>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Error : %s\0A\00"
define void @err_handler(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 ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Error : %s\0A\00"
define void @err_handler(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_E0int64_midword_reg(long long val) {
  return ((val >> 16) & (0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xe0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E0int64_midword_reg(i64 %0) {
%2 = and i64 %0, 14680064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long __syscall3(long n, long a1, long a2, long a3) {
  unsigned long __ret;
  __asm__ __volatile__("call __vsyscall"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1), "c"(a2), "D"(a3)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdi
call   1030 <__vsyscall@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall3>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rax
mov    %r8,%rdi
call   1030 <__vsyscall@plt>
ret

LLVM IR (-O0):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},{cx},{di},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},{cx},{di},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ q(int);
int main() {
  f(12);
  q(12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <f@plt>
mov    $0xc,%edi
call   1040 <q@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 12)
%2 = call i32 @q(i32 12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 12)
%2 = tail call i32 @q(i32 12)
ret i32 0
}
/* Variables and functions */
int close(int);
int tap_close(int fd, char *dev) { return close(fd); }


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

x86 assembly (clang, -O2):
<tap_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @tap_close(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @tap_close(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @close(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ejecutarComando(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char *line;
  line = (char *)malloc(1024 * sizeof(char));
  fflush(stdin);
  scanf("%[^\n]", line);
  ejecutarComando(line);
  free(line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x10(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ejecutarComando@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <ejecutarComando@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%[^\0A]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 1024)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @ejecutarComando(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%[^\0A]\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1024)
%2 = inttoptr i64 %1 to i8*
%3 = load i32, i32* @stdin
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = tail call i32 @ejecutarComando(i8* %2)
%7 = tail call i32 @free(i8* %2)
ret i32 0
}
int test_imm_70int64_lowword_mem(long long *val) {
  return ((*val) & (0x70 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_70int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 112
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int compareDoubles(void *value1, void *value2) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @compareDoubles(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
int test_imm_83uint32_reg(unsigned int val) {
  return ((val) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x83,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_83uint32_reg(i32 %0) {
%2 = and i32 %0, 131
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ esp_sdio_exit();
void rockchip_wifi_exit_module(void) { esp_sdio_exit(); }


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

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

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

LLVM IR (-O2):
define void @rockchip_wifi_exit_module() {
%1 = tail call i32 (...) @esp_sdio_exit()
ret void
}
int bcd_adjust(int value) {
  if ((value & 0xf) >= 0xa)
    value = value + 0x10 - 0xa;
  if ((value & 0xf0) >= 0xa0)
    value = value - 0xa0 + 0x100;
  return value;
}


x86 assembly (clang, -O0):
<bcd_adjust>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
cmp    $0xa,%eax
jl     1122 <bcd_adjust+0x22>
mov    -0x4(%rbp),%eax
add    $0x10,%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
cmp    $0xa0,%eax
jl     1145 <bcd_adjust+0x45>
mov    -0x4(%rbp),%eax
sub    $0xa0,%eax
add    $0x100,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd_adjust>:
mov    %edi,%eax
and    $0xe,%eax
lea    0x6(%rdi),%ecx
cmp    $0xa,%eax
cmovb  %edi,%ecx
mov    %ecx,%edx
and    $0xe0,%edx
lea    0x60(%rcx),%eax
cmp    $0xa0,%edx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bcd_adjust(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 16
%9 = sub nsw i32 %8, 10
store i32 %9, i32* %2
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 240
%13 = icmp sge i32 %12, 160
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %2
%16 = sub nsw i32 %15, 160
%17 = add nsw i32 %16, 256
store i32 %17, i32* %2
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @bcd_adjust(i32 %0) {
%2 = and i32 %0, 14
%3 = icmp ugt i32 %2, 9
%4 = add nsw i32 %0, 6
%5 = select i1 %3, i32 %4, i32 %0
%6 = and i32 %5, 224
%7 = icmp ugt i32 %6, 159
%8 = add nsw i32 %5, 96
%9 = select i1 %7, i32 %8, i32 %5
ret i32 %9
}
int test_imm_F3int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xf3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F3int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 243
%7 = icmp ne i64 %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_F3int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1043677052928
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: smtpbm ip-address port username from-address [cpu]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Usage: smtpbm ip-address port username from-address [cpu]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Usage: smtpbm ip-address port username from-address [cpu]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ kvm_hypercall(int, unsigned long);
void virtio_set_status(unsigned long dev_addr) { kvm_hypercall(2, dev_addr); }


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

x86 assembly (clang, -O2):
<virtio_set_status>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <kvm_hypercall@plt>

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

LLVM IR (-O2):
define void @virtio_set_status(i64 %0) {
%2 = tail call i32 @kvm_hypercall(i32 2, i64 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t get_time(void) {
  struct timeval T;
  gettimeofday(&T, NULL);
  return (T.tv_sec * 1000000) + T.tv_usec;
}


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

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void TelosbSensorReadingNoMessageEditsC__Leds__led1Toggle(void) {
  LedsP__Leds__led1Toggle();
}


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

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

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

LLVM IR (-O2):
define void @TelosbSensorReadingNoMessageEditsC__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
/* Variables and functions */
unsigned short __gnu_d2h_internal(unsigned long long, int /*<<< orphan*/);
unsigned short __gnu_d2h_alternative(unsigned long long x) {
  return __gnu_d2h_internal(x, 0);
}


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

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

LLVM IR (-O0):
define zeroext i16 @__gnu_d2h_alternative(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call zeroext i16 @__gnu_d2h_internal(i64 %3, i32 0)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @__gnu_d2h_alternative(i64 %0) {
%2 = tail call zeroext i16 @__gnu_d2h_internal(i64 %0, i32 0)
ret i16 %2
}
int leading_1_pos(unsigned u) {
  int pos = 0;
  while (u) {
    pos++;
    u >>= 1;
  }
  return pos;
}


x86 assembly (clang, -O0):
<leading_1_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <leading_1_pos+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <leading_1_pos+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leading_1_pos>:
xor    %eax,%eax
test   %edi,%edi
je     111c <leading_1_pos+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <leading_1_pos+0x10>
ret

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

LLVM IR (-O2):
define i32 @leading_1_pos(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
int imin(int a, int b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <imin+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imin+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int sums(int i) {
  int j, sum = 0;
  for (j = 1; j <= i; j++)
    sum = sum + j;
  return sum;
}


x86 assembly (clang, -O0):
<sums>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <sums+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <sums+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sums>:
test   %edi,%edi
jle    1118 <sums+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sums(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @sums(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__47__IO__selectModuleFunc();
void Msp430Adc12ImplP__Port67__selectModuleFunc(void) {
  HplMsp430GeneralIOP__47__IO__selectModuleFunc();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port67__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__47__IO__selectModuleFunc()
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char const *);
int is_valid_enable_directory_listing(const char *enable) {
  return strcasecmp("yes", enable) == 0 || strcasecmp("no", enable) == 0;
}


x86 assembly (clang, -O0):
<is_valid_enable_directory_listing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <is_valid_enable_directory_listing+0x48>
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_enable_directory_listing>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1144 <is_valid_enable_directory_listing+0x34>
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @is_valid_enable_directory_listing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strcasecmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @is_valid_enable_directory_listing(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int getTIssue();
int main() {
  int a = 14;
  a = getTIssue();
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getTIssue@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 <getTIssue@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getTIssue()
ret i32 %1
}
unsigned long int sumsq1N(unsigned long int n) {
  return ((n * (n + 1) * (2 * n + 1)) / 6);
}


x86 assembly (clang, -O0):
<sumsq1N>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x1,%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x6,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumsq1N>:
lea    0x1(%rdi),%rcx
imul   %rdi,%rcx
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
imul   %rcx,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @sumsq1N(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = mul i64 %3, %5
%7 = load i64, i64* %2
%8 = mul i64 2, %7
%9 = add i64 %8, 1
%10 = mul i64 %6, %9
%11 = udiv i64 %10, 6
ret i64 %11
}

LLVM IR (-O2):
define i64 @sumsq1N(i64 %0) {
%2 = add i64 %0, 1
%3 = mul i64 %2, %0
%4 = shl i64 %0, 1
%5 = or i64 %4, 1
%6 = mul i64 %3, %5
%7 = udiv i64 %6, 6
ret i64 %7
}
unsigned long ularith_div2mod(const unsigned long n, const unsigned long m) {
  ;
  if (n % 2UL == 0UL)
    return n / 2UL;
  else
    return n / 2UL + m / 2UL + 1UL;
}


x86 assembly (clang, -O0):
<ularith_div2mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    112f <ularith_div2mod+0x2f>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114a <ularith_div2mod+0x4a>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    -0x18(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ularith_div2mod>:
mov    %rdi,%rcx
shr    %rcx
shr    %rsi
test   $0x1,%dil
lea    0x1(%rcx,%rsi,1),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @ularith_div2mod(i64 %0, i64 %1) {
%3 = and i64 %0, 1
%4 = icmp eq i64 %3, 0
%5 = lshr i64 %0, 1
%6 = lshr i64 %1, 1
%7 = add nuw i64 %5, 1
%8 = add nuw i64 %7, %6
%9 = select i1 %4, i64 %5, i64 %8
ret i64 %9
}
/* Variables and functions */
scalar_t__ test_kernels();
scalar_t__ test_parallel();
int main() {
  if (test_parallel())
    return 1;
  if (test_kernels())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_parallel@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    $0x0,%al
call   1040 <test_kernels@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_parallel@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <main+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <test_kernels@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test_parallel()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @test_kernels()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int server_recv(int fd, char *buffer, int bufferSize) {
  int n;
  n = recv(fd, buffer, bufferSize, 0);
  return n;
}


x86 assembly (clang, -O0):
<server_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_recv>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @server_recv(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @recv(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @server_recv(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}