xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "DEMO semigroup DFT convolution     \n");
  fprintf(stderr, "gaussconv_dft in sigma N outlabel  \n");
  fprintf(stderr, "          N - number of iterations \n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0d(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"DEMO semigroup DFT convolution \0A\00"
@.str.1 = [37 x i8] c"gaussconv_dft in sigma N outlabel \0A\00"
@.str.2 = [37 x i8] c" N - number of iterations \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"DEMO semigroup DFT convolution \0A\00"
@.str.1 = [37 x i8] c"gaussconv_dft in sigma N outlabel \0A\00"
@.str.2 = [37 x i8] c" N - number of iterations \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IOoutput(int, int);
void SetAllIO(void) {
  int chip_no;
  for (chip_no = 0; chip_no <= 7; chip_no++)
    IOoutput(chip_no, 0xFF);
}


x86 assembly (clang, -O0):
<SetAllIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jg     1144 <SetAllIO+0x34>
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <SetAllIO+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetAllIO>:
push   %rax
xor    %edi,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x2,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x3,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x4,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x5,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x6,%edi
mov    $0xff,%esi
call   1030 <IOoutput@plt>
mov    $0x7,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <IOoutput@plt>

LLVM IR (-O0):
define void @SetAllIO() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 7
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @IOoutput(i32 %6, i32 255)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @SetAllIO() {
%1 = tail call i32 @IOoutput(i32 0, i32 255)
%2 = tail call i32 @IOoutput(i32 1, i32 255)
%3 = tail call i32 @IOoutput(i32 2, i32 255)
%4 = tail call i32 @IOoutput(i32 3, i32 255)
%5 = tail call i32 @IOoutput(i32 4, i32 255)
%6 = tail call i32 @IOoutput(i32 5, i32 255)
%7 = tail call i32 @IOoutput(i32 6, i32 255)
%8 = tail call i32 @IOoutput(i32 7, i32 255)
ret void
}
unsigned char getCardValue(unsigned char card) {
  switch (card) {
  case 'A':
    return 1;
  case 'T':
    return 10;
  case 'J':
    return 11;
  case 'Q':
    return 12;
  case 'K':
    return 13;
  default:
    return card - 0x30;
  }
}


x86 assembly (clang, -O0):
<getCardValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1161 <getCardValue+0x61>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x1,-0x1(%rbp)
jmp    116b <getCardValue+0x6b>
movb   $0xa,-0x1(%rbp)
jmp    116b <getCardValue+0x6b>
movb   $0xb,-0x1(%rbp)
jmp    116b <getCardValue+0x6b>
movb   $0xc,-0x1(%rbp)
jmp    116b <getCardValue+0x6b>
movb   $0xd,-0x1(%rbp)
jmp    116b <getCardValue+0x6b>
movzbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCardValue>:
lea    -0x41(%rdi),%ecx
cmp    $0x13,%cl
ja     1120 <getCardValue+0x20>
mov    $0x1,%al
movzbl %cl,%ecx
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xb,%al
ret
add    $0xd0,%dil
mov    %edi,%eax
ret
mov    $0xd,%al
ret
mov    $0xc,%al
ret
mov    $0xa,%al
ret

LLVM IR (-O0):
define zeroext i8 @getCardValue(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %11 [
i32 65, label %6
i32 84, label %7
i32 74, label %8
i32 81, label %9
i32 75, label %10
]
6: ; preds = %1
store i8 1, i8* %2
br label %16
7: ; preds = %1
store i8 10, i8* %2
br label %16
8: ; preds = %1
store i8 11, i8* %2
br label %16
9: ; preds = %1
store i8 12, i8* %2
br label %16
10: ; preds = %1
store i8 13, i8* %2
br label %16
11: ; preds = %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %16
16: ; preds = %11, %10, %9, %8, %7, %6
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @getCardValue(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 65, label %8
i8 84, label %2
i8 74, label %3
i8 81, label %4
i8 75, label %5
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = add i8 %0, -48
br label %8
8: ; preds = %1, %6, %5, %4, %3, %2
%9 = phi i8 [ %7, %6 ], [ 13, %5 ], [ 12, %4 ], [ 11, %3 ], [ 10, %2 ], [ 1, %1 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
main() {
  char str1[101];
  fgets(str1, 10, stdin);
  printf("%s\n", str1);
  fgets(str1, 10, stdin);
  printf("%s\n", str1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <fgets@plt>
lea    0xeb6(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <fgets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 10, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %2, i32 10, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoGuessN340(int /*<<< orphan*/);
int /*<<< orphan*/ namco_setParamsE0XX(int /*<<< orphan*/, int);
int /*<<< orphan*/ namco_setParamsE0XX_N340(int /*<<< orphan*/, int);
void namco_setParamsE0XX_GuessN340(uint16_t addr, uint8_t val) {
  if ((val & 0xC0) != 0) {
    namcoGuessN340(addr);
    namco_setParamsE0XX_N340(addr, val);
  } else
    namco_setParamsE0XX(addr, val);
}


x86 assembly (clang, -O0):
<namco_setParamsE0XX_GuessN340>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc0,%eax
cmp    $0x0,%eax
je     1167 <namco_setParamsE0XX_GuessN340+0x37>
mov    -0x4(%rbp),%edi
call   1030 <namcoGuessN340@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <namco_setParamsE0XX_N340@plt>
jmp    1172 <namco_setParamsE0XX_GuessN340+0x42>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <namco_setParamsE0XX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namco_setParamsE0XX_GuessN340>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0xc0,%bl
je     1152 <namco_setParamsE0XX_GuessN340+0x22>
mov    %ebp,%edi
call   1030 <namcoGuessN340@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <namco_setParamsE0XX_N340@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <namco_setParamsE0XX@plt>

LLVM IR (-O0):
define void @namco_setParamsE0XX_GuessN340(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 @namcoGuessN340(i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @namco_setParamsE0XX_N340(i32 %11, i32 %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 @namco_setParamsE0XX(i32 %15, i32 %16)
br label %18
18: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
define void @namco_setParamsE0XX_GuessN340(i32 %0, i32 %1) {
%3 = and i32 %1, 192
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @namcoGuessN340(i32 %0)
%7 = tail call i32 @namco_setParamsE0XX_N340(i32 %0, i32 %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @namco_setParamsE0XX(i32 %0, i32 %1)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int atan(double);
double cos(double);
int /*<<< orphan*/ printf(char *, double);
double sin(double);
double tan(double);
int main() {
  double x, y;
  x = atan(1.0) * (40002);
  y = tan(x) - (sin(x) / cos(x));
  printf("%e\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe99(%rip),%xmm0
call   1050 <atan@plt>
imul   $0x9c42,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <tan@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xea4(%rip),%xmm0
call   1050 <atan@plt>
imul   $0x9c42,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
call   1060 <tan@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @atan(double 1.000000e+00)
%5 = mul nsw i32 %4, 40002
%6 = sitofp i32 %5 to double
store double %6, double* %2
%7 = load double, double* %2
%8 = call double @tan(double %7)
%9 = load double, double* %2
%10 = call double @sin(double %9)
%11 = load double, double* %2
%12 = call double @cos(double %11)
%13 = fdiv double %10, %12
%14 = fsub double %8, %13
store double %14, double* %3
%15 = load double, double* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = tail call i32 @atan(double 1.000000e+00)
%2 = mul nsw i32 %1, 40002
%3 = sitofp i32 %2 to double
%4 = tail call double @tan(double %3)
%5 = tail call double @sin(double %3)
%6 = tail call double @cos(double %3)
%7 = fdiv double %5, %6
%8 = fsub double %4, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
bool path_exists(const char *path) {
  struct stat buf;
  return (stat(path, &buf) == 0);
}


x86 assembly (clang, -O0):
<path_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @path_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @path_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_D0uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xD0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D0uint64_highword_reg>:
movabs $0xd000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D0uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 208
%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_D0uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 893353197568
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void print(const char *data, size_t data_length) {
  for (size_t i = 0; i < data_length; i++)
    putchar((int)((const unsigned char *)data)[i]);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <print+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <print+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %5
}
void gtk_tree_model_get_n_columns() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_get_n_columns() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigterm(int signo) { exit(0); }


x86 assembly (clang, -O0):
<sigterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigterm>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigterm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigterm(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct winsize {
  int ws_col;
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  struct winsize size;
  ioctl(0, TIOCGWINSZ, (char *)&size);
  printf("cols: %d rows: %d\n", size.ws_col, size.ws_row);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1040 <ioctl@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1040 <ioctl@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32, i32 }
@TIOCGWINSZ = global i32 0
@.str = [19 x i8] c"cols: %d rows: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.winsize
store i32 0, i32* %1
%3 = load i32, i32* @TIOCGWINSZ
%4 = bitcast %struct.winsize* %2 to i8*
%5 = call i32 @ioctl(i32 0, i32 %3, i8* %4)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
%struct.winsize = type { i32, i32 }
@TIOCGWINSZ = global i32 0
@.str = [19 x i8] c"cols: %d rows: %d\0A\00"
define i32 @main() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 0, i32 %3, i8* %2)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}
/* Variables and functions */
void *Escape_DoString(char const *, int const *, void const *, size_t,
                      size_t *);
void *Escape_Do(char escByte, int const *bytesToEsc, void const *bufIn,
                size_t sizeIn, size_t *sizeOut) {
  const char escStr[] = {escByte, '\0'};
  return Escape_DoString(escStr, bytesToEsc, bufIn, sizeIn, sizeOut);
}


x86 assembly (clang, -O0):
<Escape_Do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2a(%rbp)
movb   $0x0,-0x29(%rbp)
lea    -0x2a(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <Escape_DoString@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Escape_Do>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <Escape_DoString@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @Escape_Do(i8 signext %0, i32* %1, i8* %2, i64 %3, i64* %4) {
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64*
%11 = alloca [2 x i8]
store i8 %0, i8* %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64* %4, i64** %10
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%13 = load i8, i8* %6
store i8 %13, i8* %12
%14 = getelementptr inbounds i8, i8* %12, i64 1
store i8 0, i8* %14
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load i8*, i8** %8
%18 = load i64, i64* %9
%19 = load i64*, i64** %10
%20 = call i8* @Escape_DoString(i8* %15, i32* %16, i8* %17, i64 %18, i64* %19)
ret i8* %20
}

LLVM IR (-O2):
define i8* @Escape_Do(i8 signext %0, i32* %1, i8* %2, i64 %3, i64* %4) {
%6 = alloca [2 x i8]
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 %0, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 0, i8* %8
%9 = call i8* @Escape_DoString(i8* %7, i32* %1, i8* %2, i64 %3, i64* %4)
ret i8* %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t convert_byte_array_to_16_bit(uint8_t *data) {
  return (data[0] | ((uint16_t)data[1] << 8));
}


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

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

LLVM IR (-O0):
define i32 @convert_byte_array_to_16_bit(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @convert_byte_array_to_16_bit(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_enable() {
  mbus_remote_register_write(0x6, 0x3B,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) |
                              (1 << 12) | (1 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0xfffff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_enable>:
push   %rax
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0xfffff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_enable() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 59, i32 1048575)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_enable() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 59, i32 1048575)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reg_addrange(int, int);
void reg_addranges_s(void) {
  reg_addrange(0x9, 0x9);
  reg_addrange(0xA, 0xD);
  reg_addrange(0x20, 0x20);
  reg_addrange(0xA0, 0xA0);
  reg_addrange(0x2028, 0x2029);
  reg_addrange(0xFEFF, 0xFEFF);
}


x86 assembly (clang, -O0):
<reg_addranges_s>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%esi
mov    %esi,%edi
call   1030 <reg_addrange@plt>
mov    $0xa,%edi
mov    $0xd,%esi
call   1030 <reg_addrange@plt>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <reg_addrange@plt>
mov    $0xa0,%esi
mov    %esi,%edi
call   1030 <reg_addrange@plt>
mov    $0x2028,%edi
mov    $0x2029,%esi
call   1030 <reg_addrange@plt>
mov    $0xfeff,%esi
mov    %esi,%edi
call   1030 <reg_addrange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_addranges_s>:
push   %rax
mov    $0x9,%edi
mov    $0x9,%esi
call   1030 <reg_addrange@plt>
mov    $0xa,%edi
mov    $0xd,%esi
call   1030 <reg_addrange@plt>
mov    $0x20,%edi
mov    $0x20,%esi
call   1030 <reg_addrange@plt>
mov    $0xa0,%edi
mov    $0xa0,%esi
call   1030 <reg_addrange@plt>
mov    $0x2028,%edi
mov    $0x2029,%esi
call   1030 <reg_addrange@plt>
mov    $0xfeff,%edi
mov    $0xfeff,%esi
pop    %rax
jmp    1030 <reg_addrange@plt>

LLVM IR (-O0):
define void @reg_addranges_s() {
%1 = call i32 @reg_addrange(i32 9, i32 9)
%2 = call i32 @reg_addrange(i32 10, i32 13)
%3 = call i32 @reg_addrange(i32 32, i32 32)
%4 = call i32 @reg_addrange(i32 160, i32 160)
%5 = call i32 @reg_addrange(i32 8232, i32 8233)
%6 = call i32 @reg_addrange(i32 65279, i32 65279)
ret void
}

LLVM IR (-O2):
define void @reg_addranges_s() {
%1 = tail call i32 @reg_addrange(i32 9, i32 9)
%2 = tail call i32 @reg_addrange(i32 10, i32 13)
%3 = tail call i32 @reg_addrange(i32 32, i32 32)
%4 = tail call i32 @reg_addrange(i32 160, i32 160)
%5 = tail call i32 @reg_addrange(i32 8232, i32 8233)
%6 = tail call i32 @reg_addrange(i32 65279, i32 65279)
ret void
}
int local_bh_enable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @local_bh_enable() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1;
  int *pointer_to_a = &a;
  a++;
  (*pointer_to_a)++;
  printf("The value of a is now %d.\n", a);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"The value of a is now %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 1, i32* %1
store i32* %1, i32** %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"The value of a is now %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
int count(char *tokens, char search) {
  char token;
  int count = 0;
  do {
    token = *tokens;
    if (token == search)
      count++;
    tokens++;
  } while (token != '\0');
  return count;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1137 <count+0x37>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movsbl -0xa(%rbp),%eax
cmp    $0x0,%eax
jne    1115 <count+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count+0x10>
ret

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

LLVM IR (-O2):
define i32 @count(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i32 [ 0, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 %9
}
int main() {
  unsigned int l = 0;
  l = 0;
  if (l % 2U)
    l = 5;
  if (!(l % 2U))
    l = l + 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112f <main+0x2f>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1147 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void killcomments(char *s) {
  char *p;
  if (s && (p = strchr(s, '#')))
    *p = '\0';
}


x86 assembly (clang, -O0):
<killcomments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <killcomments+0x3a>
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     114a <killcomments+0x3a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killcomments>:
push   %rax
test   %rdi,%rdi
je     1128 <killcomments+0x18>
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1128 <killcomments+0x18>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @killcomments(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @strchr(i8* %0, i8 signext 35)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8 0, i8* %4
br label %7
7: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ canid_t;

/* Variables and functions */
scalar_t__ ioctl(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int can_set_own_id(int fd, canid_t id) {
  if (ioctl(fd, 0x4501, id) != 0) {
    perror("Can Test Set ID: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<can_set_own_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x4501,%esi
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1160 <can_set_own_id+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <can_set_own_id+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_set_own_id>:
push   %rax
mov    %esi,%edx
mov    $0x4501,%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1139 <can_set_own_id+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Can Test Set ID: \00"
define i32 @can_set_own_id(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 = call i64 @ioctl(i32 %6, i32 17665, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"Can Test Set ID: \00"
define i32 @can_set_own_id(i32 %0, i32 %1) {
%3 = tail call i64 @ioctl(i32 %0, i32 17665, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int semaphore_decr(int, int);
int mutex_lock(int m_id) { return semaphore_decr(m_id, 1); }


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

x86 assembly (clang, -O2):
<mutex_lock>:
mov    $0x1,%esi
jmp    1030 <semaphore_decr@plt>

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

LLVM IR (-O2):
define i32 @mutex_lock(i32 %0) {
%2 = tail call i32 @semaphore_decr(i32 %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t rm_get_uint8(uint8_t *buf) { return (uint8_t)buf[0]; }


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

x86 assembly (clang, -O2):
<rm_get_uint8>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @rm_get_uint8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ memcmp(void *, void *, size_t);
bool MemEqual(void *A, void *B, size_t Size) { return memcmp(A, B, Size) == 0; }


x86 assembly (clang, -O0):
<MemEqual>:
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 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MemEqual(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @MemEqual(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void byteSwap(unsigned int *buf, unsigned words) {
  unsigned char *p;
  int i = 1;
  if (*(char *)&i == 1)
    return;
  p = (unsigned char *)buf;
  do {
    *buf++ = (unsigned int)((unsigned)p[3] << 8 | p[2]) << 16 |
             ((unsigned)p[1] << 8 | p[0]);
    p += 4;
  } while (--words);
}


x86 assembly (clang, -O0):
<byteSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x1c(%rbp)
movsbl -0x1c(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <byteSwap+0x24>
jmp    1189 <byteSwap+0x89>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x3(%rax),%ecx
shl    $0x8,%ecx
mov    -0x18(%rbp),%rax
movzbl 0x2(%rax),%eax
or     %eax,%ecx
shl    $0x10,%ecx
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rdx
movzbl (%rdx),%edx
or     %edx,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    112c <byteSwap+0x2c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @byteSwap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %6
%7 = bitcast i32* %6 to i8*
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %46
12: ; preds = %2
%13 = load i32*, i32** %3
%14 = bitcast i32* %13 to i8*
store i8* %14, i8** %5
br label %15
15: ; preds = %42, %12
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %20, %24
%26 = shl i32 %25, 16
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 8
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = or i32 %31, %35
%37 = or i32 %26, %36
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i32 1
store i32* %39, i32** %3
store i32 %37, i32* %38
%40 = load i8*, i8** %5
%41 = getelementptr inbounds i8, i8* %40, i64 4
store i8* %41, i8** %5
br label %42
42: ; preds = %15
%43 = load i32, i32* %4
%44 = add i32 %43, -1
store i32 %44, i32* %4
%45 = icmp ne i32 %44, 0
br i1 %45, label %15, label %46
46: ; preds = %11, %42
ret void
}

LLVM IR (-O2):
define void @byteSwap(i32* nocapture %0, i32 %1) {
ret void
}
void snd_media_stream_delete(struct snd_usb_substream *subs) {}


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

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

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

LLVM IR (-O2):
%struct.snd_usb_substream = type opaque
define void @snd_media_stream_delete(%struct.snd_usb_substream* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void playerInBedroomUseBat() {
  puts("\nYou swing your bat around your bedroom and, in your gusto, break "
       "part of your dresser. Oops!");
}


x86 assembly (clang, -O0):
<playerInBedroomUseBat>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [94 x i8] c"\0AYou swing your bat around your bedroom and, in your gusto, break part of your dresser. Oops!\00"
define void @playerInBedroomUseBat() {
%1 = call i32 @puts(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [94 x i8] c"\0AYou swing your bat around your bedroom and, in your gusto, break part of your dresser. Oops!\00"
define void @playerInBedroomUseBat() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
ret void
}
void teardown() { ; }


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

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

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

LLVM IR (-O2):
define void @teardown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void wake_me(int seconds, void (*func)(int)) {
  signal(SIGALRM, func);
  alarm(seconds);
}


x86 assembly (clang, -O0):
<wake_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <signal@plt>
mov    -0x4(%rbp),%edi
call   1030 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wake_me>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1040 <signal@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <alarm@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @wake_me(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%5 = load i32, i32* @SIGALRM
%6 = load void (i32)*, void (i32)** %4
%7 = call i32 @signal(i32 %5, void (i32)* %6)
%8 = load i32, i32* %3
%9 = call i32 @alarm(i32 %8)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @wake_me(i32 %0, void (i32)* %1) {
%3 = load i32, i32* @SIGALRM
%4 = tail call i32 @signal(i32 %3, void (i32)* %1)
%5 = tail call i32 @alarm(i32 %0)
ret void
}
void EPIModeSet(unsigned long ulBase, unsigned long ulMode) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulMode;
}


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

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

LLVM IR (-O0):
define void @EPIModeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIModeSet(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
int __ev_rj_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_rj_changed() {
ret i32 0
}
_Bool audio_init(void *handle) {
  startRecording();
  return 1;
}


x86 assembly (clang, -O0):
<audio_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <startRecording@plt>
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @audio_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @startRecording()
ret i1 true
}

LLVM IR (-O2):
define zeroext i1 @audio_init(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @startRecording()
ret i1 true
}