xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ d0Somethin();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int);
int main() {
  int a;
  scanf("%d", a);
  d0Somethin();
  for (int i = 0; i <= a; i++) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1030 <d0Somethin@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1185 <main+0x55>
mov    -0xc(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <main+0x2c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1050 <scanf@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <d0Somethin@plt>
lea    0xeb3(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @d0Somethin()
store i32 0, i32* %3
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %7
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 (...) @d0Somethin()
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
br label %3
}
void right_case_4(struct rbt *tree, struct node *node, struct node *sibling) {}


x86 assembly (clang, -O0):
<right_case_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rbt = type opaque
%struct.node = type opaque
define void @right_case_4(%struct.rbt* %0, %struct.node* %1, %struct.node* %2) {
%4 = alloca %struct.rbt*
%5 = alloca %struct.node*
%6 = alloca %struct.node*
store %struct.rbt* %0, %struct.rbt** %4
store %struct.node* %1, %struct.node** %5
store %struct.node* %2, %struct.node** %6
ret void
}

LLVM IR (-O2):
%struct.rbt = type opaque
%struct.node = type opaque
define void @right_case_4(%struct.rbt* nocapture %0, %struct.node* nocapture %1, %struct.node* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void display_usage() {
  const char usage[] =
      "Usage: particle [options] file\n\n"
      "Description:\n"
      "  Interprets particle files, assembles particle assembly files,\n"
      "  or runs particle machine code.\n\n"
      "Options:\n"
      "  -h           Display this information\n"
      "  -a FILE      Output generated assembly code to FILE\n"
      "  -m FILE      Output generated machine code to FILE\n"
      "  -x LANGUAGE  Specify the language of the input file.\n"
      "               Can be: particle (default), assembly, or machine.\n"
      "  \n";
  printf("%s", usage);
}


x86 assembly (clang, -O0):
<display_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
lea    -0x1b0(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1a7,%edx
call   1040 <memcpy@plt>
lea    -0x1b0(%rbp),%rsi
lea    0x1056(%rip),%rdi
call   1030 <printf@plt>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_usage>:
push   %rbx
sub    $0x1b0,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x1a7,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0x1061(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.display_usage.usage = [423 x i8] c"Usage: particle [options] file\0A\0ADescription:\0A Interprets particle files, assembles particle assembly files,\0A or runs particle machine code.\0A\0AOptions:\0A -h Display this information\0A -a FILE Output generated assembly code to FILE\0A -m FILE Output generated machine code to FILE\0A -x LANGUAGE Specify the language of the input file.\0A Can be: particle (default), assembly, or machine.\0A \0A\00"
@.str = [3 x i8] c"%s\00"
define void @display_usage() {
%1 = alloca [423 x i8]
%2 = bitcast [423 x i8]* %1 to i8*
%3 = getelementptr inbounds [423 x i8], [423 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@__const.display_usage.usage = [423 x i8] c"Usage: particle [options] file\0A\0ADescription:\0A Interprets particle files, assembles particle assembly files,\0A or runs particle machine code.\0A\0AOptions:\0A -h Display this information\0A -a FILE Output generated assembly code to FILE\0A -m FILE Output generated machine code to FILE\0A -x LANGUAGE Specify the language of the input file.\0A Can be: particle (default), assembly, or machine.\0A \0A\00"
@.str = [3 x i8] c"%s\00"
define void @display_usage() {
%1 = alloca [423 x i8]
%2 = getelementptr inbounds [423 x i8], [423 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Output_byte(int);
int /*<<< orphan*/ far_branch(int);
void group_relative16(int opcode, int preoffset) {
  Output_byte(opcode);
  far_branch(preoffset);
}


x86 assembly (clang, -O0):
<group_relative16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Output_byte@plt>
mov    -0x8(%rbp),%edi
call   1030 <far_branch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<group_relative16>:
push   %rbx
mov    %esi,%ebx
call   1040 <Output_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <far_branch@plt>

LLVM IR (-O0):
define void @group_relative16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @Output_byte(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @far_branch(i32 %7)
ret void
}

LLVM IR (-O2):
define void @group_relative16(i32 %0, i32 %1) {
%3 = tail call i32 @Output_byte(i32 %0)
%4 = tail call i32 @far_branch(i32 %1)
ret void
}
main() {
  typedef unsigned short ty;
  ty a = 5, b = 20;
  return (a - b) < 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x5,-0x6(%rbp)
movw   $0x14,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
sub    %ecx,%eax
cmp    $0xa,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 5, i16* %2
store i16 20, i16* %3
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = sub nsw i32 %5, %7
%9 = icmp slt i32 %8, 10
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void arm_stc2() {}


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

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

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

LLVM IR (-O2):
define void @arm_stc2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xe1() {
  Assert_real((islower(225) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1130, ("islower should be 0 for 0xe1"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xe1>:
push   %rax
mov    $0xe1,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe1\00"
define void @t_islower_0xe1() {
%1 = tail call i64 @islower(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double calcGeomMeanLongSun(double);
double calcSunEqOfCenter(double);
double calcSunTrueLong(double t) {
  double l0 = calcGeomMeanLongSun(t);
  double c = calcSunEqOfCenter(t);
  double O = l0 + c;
  return O;
}


x86 assembly (clang, -O0):
<calcSunTrueLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <calcGeomMeanLongSun@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <calcSunEqOfCenter@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSunTrueLong>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <calcGeomMeanLongSun@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <calcSunEqOfCenter@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calcSunTrueLong(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @calcGeomMeanLongSun(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = call double @calcSunEqOfCenter(double %8)
store double %9, double* %4
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fadd double %10, %11
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @calcSunTrueLong(double %0) {
%2 = tail call double @calcGeomMeanLongSun(double %0)
%3 = tail call double @calcSunEqOfCenter(double %0)
%4 = fadd double %2, %3
ret double %4
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostPwrDisable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) &= ~0x00000004;
}


x86 assembly (clang, -O0):
<USBHostPwrDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrDisable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xfffffffb,0x400(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @USBHostPwrDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1024
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, -5
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @USBHostPwrDisable(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1024
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -5
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
double _asin(double);
double asin(double x) { return _asin(x); }


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

x86 assembly (clang, -O2):
<asin>:
jmp    1030 <_asin@plt>

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

LLVM IR (-O2):
define double @asin(double %0) {
%2 = tail call double @_asin(double %0)
ret double %2
}
int unconditional(int n) { return (n = 1); }


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

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

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

LLVM IR (-O2):
define i32 @unconditional(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ sprintf(char *, char *);
void _my_free(void **data) {
  char fail[256];
  if (((void *)0) == data || ((void *)0) == *data) {
    sprintf(fail, "free: attempted to free NULL pointer.\n");
    ;
  }
  free(*data);
  *data = ((void *)0);
}


x86 assembly (clang, -O0):
<_my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     114a <_my_free+0x2a>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
jne    115d <_my_free+0x3d>
lea    -0x110(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_my_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"free: attempted to free NULL pointer.\0A\00"
define void @_my_free(i8** %0) {
%2 = alloca i8**
%3 = alloca [256 x i8]
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp eq i8** null, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = icmp eq i8* null, %8
br i1 %9, label %10, label %13
10: ; preds = %6, %1
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%12 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %6
%14 = load i8**, i8*** %2
%15 = load i8*, i8** %14
%16 = call i32 @free(i8* %15)
%17 = load i8**, i8*** %2
store i8* null, i8** %17
ret void
}

LLVM IR (-O2):
define void @_my_free(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
char xdigit_to_hex(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  } else if (c >= 'A' && c <= 'F') {
    return c - 'A' + 10;
  } else {
    return c - 'a' + 10;
  }
}


x86 assembly (clang, -O0):
<xdigit_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <xdigit_to_hex+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <xdigit_to_hex+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    116c <xdigit_to_hex+0x6c>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115f <xdigit_to_hex+0x5f>
movsbl -0x2(%rbp),%eax
cmp    $0x46,%eax
jg     115f <xdigit_to_hex+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    116c <xdigit_to_hex+0x6c>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdigit_to_hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
jb     111a <xdigit_to_hex+0x1a>
lea    -0x41(%rdi),%eax
cmp    $0x5,%al
ja     1114 <xdigit_to_hex+0x14>
add    $0xc9,%dil
jmp    1118 <xdigit_to_hex+0x18>
add    $0xa9,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @xdigit_to_hex(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %36
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 70
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = add nsw i32 %27, 10
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %36
30: ; preds = %20, %16
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %32, 97
%34 = add nsw i32 %33, 10
%35 = trunc i32 %34 to i8
store i8 %35, i8* %2
br label %36
36: ; preds = %30, %24, %11
%37 = load i8, i8* %2
ret i8 %37
}

LLVM IR (-O2):
define signext i8 @xdigit_to_hex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i8 %0, -65
%6 = icmp ult i8 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i8 %0, -55
br label %11
9: ; preds = %4
%10 = add i8 %0, -87
br label %11
11: ; preds = %1, %9, %7
%12 = phi i8 [ %8, %7 ], [ %10, %9 ], [ %2, %1 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ bug3166064(int /*<<< orphan*/);
int /*<<< orphan*/ bug3394118(int /*<<< orphan*/);
int /*<<< orphan*/ f(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ print(char *, int);
void testBug(void) {
  bug3166064(print("%d", 1));
  bug3394118(f(0, 0));
}


x86 assembly (clang, -O0):
<testBug>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
mov    $0x1,%esi
call   1050 <print@plt>
mov    %eax,%edi
call   1060 <bug3166064@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1040 <bug3394118@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBug>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x1,%esi
call   1050 <print@plt>
mov    %eax,%edi
call   1060 <bug3166064@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <f@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <bug3394118@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @testBug() {
%1 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @bug3166064(i32 %1)
%3 = call i32 @f(i32 0, i32 0)
%4 = call i32 @bug3394118(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @testBug() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @bug3166064(i32 %1)
%3 = tail call i32 @f(i32 0, i32 0)
%4 = tail call i32 @bug3394118(i32 %3)
ret void
}
double getDS() { return (double)((1LL << 16) - 16L); }


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

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

LLVM IR (-O0):
define double @getDS() {
ret double 6.552000e+04
}

LLVM IR (-O2):
define double @getDS() {
ret double 6.552000e+04
}
int b1(int x, int y) {
  int t = x & y;
  int tt = x | y;
  unsigned t1 = t - 1;
  return t1 - tt;
}


x86 assembly (clang, -O0):
<b1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1>:
mov    %esi,%eax
and    %edi,%eax
or     %edi,%esi
not    %esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @b1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = and i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = or i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = sub i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @b1(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = or i32 %1, %0
%5 = xor i32 %4, -1
%6 = add i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int LZ5_compress_HC(char const *, char *, int, int, int /*<<< orphan*/);
int LZ5_compressHC_limitedOutput(const char *src, char *dst, int srcSize,
                                 int maxDstSize) {
  return LZ5_compress_HC(src, dst, srcSize, maxDstSize, 0);
}


x86 assembly (clang, -O0):
<LZ5_compressHC_limitedOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <LZ5_compress_HC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ5_compressHC_limitedOutput>:
xor    %r8d,%r8d
jmp    1030 <LZ5_compress_HC@plt>

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

LLVM IR (-O2):
define i32 @LZ5_compressHC_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @LZ5_compress_HC(i8* %0, i8* %1, i32 %2, i32 %3, i32 0)
ret i32 %5
}
int test_imm_A7int16_reg(short val) {
  return ((val) & (0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xa7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A7int16_reg(i16 signext %0) {
%2 = and i16 %0, 167
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ unimplemented();
void stfi_ind(void) { unimplemented(); }


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

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

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

LLVM IR (-O2):
define void @stfi_ind() {
%1 = tail call i32 (...) @unimplemented()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xea() {
  Assert_real((iscntrl(234) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1175, ("iscntrl should be 0 for 0xea"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xea>:
push   %rax
mov    $0xea,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xea\00"
define void @t_iscntrl_0xea() {
%1 = tail call i64 @iscntrl(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int if_nametoindex(char const *);
int open_by_name_index(char const *, unsigned int);
int open_by_node(char const *);
int open_device(const char *name) {
  unsigned int idx = if_nametoindex(name);
  if (idx != 0)
    return open_by_name_index(name, idx);
  return open_by_node(name);
}


x86 assembly (clang, -O0):
<open_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <if_nametoindex@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1166 <open_device+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <open_by_name_index@plt>
mov    %eax,-0x4(%rbp)
jmp    1172 <open_device+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <open_by_node@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_device>:
push   %rbx
mov    %rdi,%rbx
call   1050 <if_nametoindex@plt>
mov    %rbx,%rdi
test   %eax,%eax
je     1148 <open_device+0x18>
mov    %eax,%esi
pop    %rbx
jmp    1040 <open_by_name_index@plt>
pop    %rbx
jmp    1030 <open_by_node@plt>

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

LLVM IR (-O2):
define i32 @open_device(i8* %0) {
%2 = tail call i32 @if_nametoindex(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @open_by_name_index(i8* %0, i32 %2)
br label %8
6: ; preds = %1
%7 = tail call i32 @open_by_node(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
int wesley(int x) { return x * 157; }


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

x86 assembly (clang, -O2):
<wesley>:
imul   $0x9d,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @wesley(i32 %0) {
%2 = mul nsw i32 %0, 157
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main(void) {
  int num0 = 10;
  int num1 = 5;
  printf("old num0=%d, num1=%d \n", num0, num1);
  swap(&num0, &num1);
  printf("new num0=%d, num1=%d \n", num0, num1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x5,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"old num0=%d, num1=%d \0A\00"
@.str.1 = [23 x i8] c"new num0=%d, num1=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"old num0=%d, num1=%d \0A\00"
@.str.1 = [23 x i8] c"new num0=%d, num1=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10, i32 5)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
int foo4(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @foo4() {
ret i32 4
}

LLVM IR (-O2):
define i32 @foo4() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void fail(char *test_name, char *message) {
  printf("%s FAIL: %s", test_name, message);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s FAIL: %s\00"
define void @fail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s FAIL: %s\00"
define void @fail(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int test_imm_59uint8_mem(unsigned char *val) {
  return ((*val) & (0x59 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_59uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 89
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int pgmDrawEdge(int **pixelsl, int numRows, int numCols, int edgewidth,
                char **header) {}


x86 assembly (clang, -O0):
<pgmDrawEdge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pgmDrawEdge(i32** nocapture readnone %0, i32 %1, i32 %2, i32 %3, i8** nocapture readnone %4) {
ret i32 undef
}
double fsub(double a, double b) { return a - b; }


x86 assembly (clang, -O0):
<fsub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsub>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fsub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main() {
  foo(1, 3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 3)
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ ft_putendl(char const *);
int fail(const char *msg) {
  ft_putendl(msg);
  return (EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1030 <ft_putendl@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putendl(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
ret i32 %5
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @fail(i8* %0) {
%2 = tail call i32 @ft_putendl(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
ret i32 %3
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createCosExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x0002);
}


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

x86 assembly (clang, -O2):
<createCosExpression>:
mov    $0x2,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createCosExpression(%struct.memorycontainer* %0) {
%2 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %2
%3 = load %struct.memorycontainer*, %struct.memorycontainer** %2
%4 = call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %3, i32 2)
ret %struct.memorycontainer* %4
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createCosExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 2)
ret %struct.memorycontainer* %2
}
char i(char a, char b) { return a / b; }


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
mov    %edi,%eax
cwtd
idiv   %si
ret

LLVM IR (-O0):
define signext i8 @i(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sdiv i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @i(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = sdiv i16 %3, %4
%6 = trunc i16 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unhide(char *);
int main(int argc, char *argv[]) {
  unhide(argv[1]);
  printf(argv[1]);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <unhide@plt>
mov    0x8(%rbx),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(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 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @unhide(i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @unhide(i8* %4)
%6 = load i8*, i8** %3
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
float ratio(float c) {
  float f;
  float beta(float, float);
  f = 3.141592654 * c / (4. * beta(1. / c, 1 + 1. / c));
  return (f);
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xea7(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  0xe9b(%rip),%xmm1
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <beta@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm1,%xmm2
movsd  0xe72(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
push   %rax
cvtss2sd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm4
movsd  0xee3(%rip),%xmm2
movapd %xmm2,%xmm3
divsd  %xmm1,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
mulsd  %xmm1,%xmm4
movsd  %xmm4,(%rsp)
addsd  %xmm2,%xmm3
xorps  %xmm1,%xmm1
cvtsd2ss %xmm3,%xmm1
call   1030 <beta@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xeb7(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ratio(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double 0x400921FB54524550, %5
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fdiv double 1.000000e+00, %8
%10 = fptrunc double %9 to float
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fdiv double 1.000000e+00, %12
%14 = fadd double 1.000000e+00, %13
%15 = fptrunc double %14 to float
%16 = call float @beta(float %10, float %15)
%17 = fpext float %16 to double
%18 = fmul double 4.000000e+00, %17
%19 = fdiv double %6, %18
%20 = fptrunc double %19 to float
store float %20, float* %3
%21 = load float, float* %3
ret float %21
}

LLVM IR (-O2):
define float @ratio(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB54524550
%4 = fdiv double 1.000000e+00, %2
%5 = fptrunc double %4 to float
%6 = fadd double %4, 1.000000e+00
%7 = fptrunc double %6 to float
%8 = tail call float @beta(float %5, float %7)
%9 = fpext float %8 to double
%10 = fmul double %9, 4.000000e+00
%11 = fdiv double %3, %10
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ deinit();
int /*<<< orphan*/ exit(int);
int init();
int run();
int main(void) {
  int ret;
  ret = init();
  if (ret)
    exit(ret);
  ret = run();
  deinit();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116b <main+0x2b>
mov    -0x8(%rbp),%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1040 <run@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <deinit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <init@plt>
test   %eax,%eax
jne    1160 <main+0x20>
xor    %eax,%eax
call   1040 <run@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <deinit@plt>
mov    %ebx,%eax
pop    %rbx
ret
mov    %eax,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 %1)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @run()
%7 = tail call i32 (...) @deinit()
ret i32 %6
}
void __DELETE_java_lang_Math(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_Math(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t network_to_host_long(uint32_t l) { return ntohl(l); }


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

x86 assembly (clang, -O2):
<network_to_host_long>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @network_to_host_long(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strerr_die(int, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void usage(void) {
  strerr_die((100),
             ("rblsmtpd: usage: rblsmtpd [ -b ] [ -R ] [ -t timeout ] [ -r "
              "base ] [ -a base ] smtpd [ arg ... ]"),
             0, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
lea    0xedc(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x64,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [97 x i8] c"rblsmtpd: usage: rblsmtpd [ -b ] [ -R ] [ -t timeout ] [ -r base ] [ -a base ] smtpd [ arg ... ]\00"
define void @usage() {
%1 = call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [97 x i8] c"rblsmtpd: usage: rblsmtpd [ -b ] [ -R ] [ -t timeout ] [ -r base ] [ -a base ] smtpd [ arg ... ]\00"
define void @usage() {
%1 = tail call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
gid_t getegid(void) { return __syscall(202); }


x86 assembly (clang, -O0):
<getegid>:
push   %rbp
mov    %rsp,%rbp
mov    $0xca,%edi
call   1030 <__syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getegid>:
mov    $0xca,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getegid() {
%1 = call i32 @__syscall(i32 202)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getegid() {
%1 = tail call i32 @__syscall(i32 202)
ret i32 %1
}